From: David Garcia Date: Mon, 6 Apr 2020 10:55:23 +0000 (+0200) Subject: Fix bug 1049: Raise exception if model does not exist when destroying a model X-Git-Tag: release-v8.0-start~20 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=979df14bf7d593e6ab983c910133edf4e3feccb3;hp=df9f72a3f1e7ae1a3bc48fd8e116d8a4ee65824a Fix bug 1049: Raise exception if model does not exist when destroying a model Change-Id: I7bc64f296d6cff695511be77a5445241a1175d8a Signed-off-by: David Garcia --- diff --git a/n2vc/n2vc_juju_conn.py b/n2vc/n2vc_juju_conn.py index dbd904c..0485e69 100644 --- a/n2vc/n2vc_juju_conn.py +++ b/n2vc/n2vc_juju_conn.py @@ -1288,6 +1288,12 @@ class N2VCJujuConnector(N2VCConnector): total_timeout = 3600 model = await self._juju_get_model(model_name=model_name) + + if not model: + raise N2VCException( + message="Model {} does not exist".format(model_name) + ) + uuid = model.info.uuid # destroy applications