X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fn2vc_juju_conn.py;h=f48838d76c039d57ef46ebea9b2ed18006dbc984;hp=40f46f1e3fd01c8775b243cca37d381ebb42b4b2;hb=347aae6ea48b962db7ab868cb0533edf7b450349;hpb=fc796cc98009d16e124dd47c0596c5541dc10f4d diff --git a/n2vc/n2vc_juju_conn.py b/n2vc/n2vc_juju_conn.py index 40f46f1..f48838d 100644 --- a/n2vc/n2vc_juju_conn.py +++ b/n2vc/n2vc_juju_conn.py @@ -54,6 +54,8 @@ class N2VCJujuConnector(N2VCConnector): ################################################################################################## """ + BUILT_IN_CLOUDS = ["localhost", "microk8s"] + def __init__( self, db: object, @@ -1177,12 +1179,19 @@ class N2VCJujuConnector(N2VCConnector): if not self.enable_os_upgrade: config_dict['enable-os-refresh-update'] = False config_dict['enable-os-upgrade'] = False - - model = await self.controller.add_model( - model_name=model_name, - config=config_dict, - cloud_name=self.cloud, - ) + if self.cloud in self.BUILT_IN_CLOUDS: + model = await self.controller.add_model( + model_name=model_name, + config=config_dict, + cloud_name=self.cloud, + ) + else: + model = await self.controller.add_model( + model_name=model_name, + config=config_dict, + cloud_name=self.cloud, + credential_name="admin" + ) self.log.info('New model created, name={}'.format(model_name)) else: self.log.debug('Model already exists in juju. Getting model {}'.format(model_name))