Use default Previous Work Dir if there is none 96/8996/2 v7.0 v7.1.0 v7.1.0rc5 v7.1.0rc6 v7.1.2 v7.1.3 v7.1.4 v7.1.5
authorDominik Fleischmann <dominik.fleischmann@canonical.com>
Thu, 28 May 2020 12:33:22 +0000 (14:33 +0200)
committerDominik Fleischmann <dominik.fleischmann@canonical.com>
Thu, 28 May 2020 12:37:10 +0000 (14:37 +0200)
When the folder where the working dir was is deleted
an Exception is thrown. In that case a new default
directory is defined.

Change-Id: Ic0b3eb63625fc6cf6e90e9a77891c9958b6a9aee
Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
n2vc/k8s_juju_conn.py

index 1f9c896..b2ef079 100644 (file)
@@ -335,8 +335,10 @@ class K8sJujuConnector(K8sConnector):
                     in the package>
                 - <URL_where_to_fetch_juju_bundle>
             """
                     in the package>
                 - <URL_where_to_fetch_juju_bundle>
             """
-
-            previous_workdir = os.getcwd()
+            try:
+                previous_workdir = os.getcwd()
+            except FileNotFoundError:
+                previous_workdir = "/app/storage"
 
             bundle = kdu_model
             if kdu_model.startswith("cs:"):
 
             bundle = kdu_model
             if kdu_model.startswith("cs:"):