+ (
+ _nsi_id,
+ ns_id,
+ _vnf_id,
+ _vdu_id,
+ _vdu_count,
+ ) = self._get_namespace_components(namespace=namespace)
+ if ns_id is not None:
+ try:
+ models = await libjuju.list_models(contains=ns_id)
+ for model in models:
+ await libjuju.destroy_model(
+ model_name=model, total_timeout=total_timeout
+ )
+ except Exception as e:
+ raise N2VCException(
+ message="Error deleting namespace {} : {}".format(
+ namespace, e
+ )
+ )
+ else:
+ raise N2VCBadArgumentsException(
+ message="only ns_id is permitted to delete yet",
+ bad_args=["namespace"],
+ )
+ finally:
+ self.delete_namespace_locks.pop(namespace)