Skip exception if model doesn't exist after delete failure 98/11998/1
authorDavid Garcia <david.garcia@canonical.com>
Tue, 3 May 2022 10:23:59 +0000 (12:23 +0200)
committergarciadav <david.garcia@canonical.com>
Tue, 3 May 2022 12:23:15 +0000 (14:23 +0200)
- bug: 2018
Change-Id: I9d118602c747840a4a32fd670c8724c82c1ee094
Signed-off-by: David Garcia <david.garcia@canonical.com>
(cherry picked from commit 5c96662b238a20ecc7c516269a0b051e3b0333eb)

n2vc/libjuju.py

index 6bc9be7..a5b4d7e 100644 (file)
@@ -1179,6 +1179,10 @@ class Libjuju:
                 controller,
                 timeout=total_timeout,
             )
+        except Exception as e:
+            if not await self.model_exists(model_name, controller=controller):
+                return
+            raise e
         finally:
             if model:
                 await self.disconnect_model(model)