Raise N2VCNotFound exception in delete_namespace
[osm/N2VC.git] / n2vc / n2vc_juju_conn.py
index 4456dd9..bac0f2c 100644 (file)
@@ -32,7 +32,7 @@ from n2vc.n2vc_conn import N2VCConnector
 from n2vc.n2vc_conn import obj_to_dict, obj_to_yaml
 from n2vc.exceptions \
     import N2VCBadArgumentsException, N2VCException, N2VCConnectionException, \
-    N2VCExecutionException, N2VCInvalidCertificate
+    N2VCExecutionException, N2VCInvalidCertificate, N2VCNotFound
 from n2vc.juju_observer import JujuModelObserver
 
 from juju.controller import Controller
@@ -556,6 +556,8 @@ class N2VCJujuConnector(N2VCConnector):
                     model_name=ns_id,
                     total_timeout=total_timeout
                 )
+            except N2VCNotFound:
+                raise
             except Exception as e:
                 raise N2VCException(message='Error deleting namespace {} : {}'.format(namespace, e))
         else:
@@ -1294,7 +1296,7 @@ class N2VCJujuConnector(N2VCConnector):
         model = await self._juju_get_model(model_name=model_name)
 
         if not model:
-            raise N2VCException(
+            raise N2VCNotFound(
                 message="Model {} does not exist".format(model_name)
             )