from n2vc.n2vc_conn import obj_to_dict, obj_to_yaml
from n2vc.exceptions \
import N2VCBadArgumentsException, N2VCException, N2VCConnectionException, \
from n2vc.n2vc_conn import obj_to_dict, obj_to_yaml
from n2vc.exceptions \
import N2VCBadArgumentsException, N2VCException, N2VCConnectionException, \
- .format(ee_id_1, ee_id_2, endpoint_1, endpoint_2))
+ .format(ee_id_1, ee_id_2, endpoint_1, endpoint_2))
except Exception as e:
self.log.debug('Error executing verify-ssh-credentials: {}. Retrying...'.format(e))
await asyncio.sleep(retry_timeout)
except Exception as e:
self.log.debug('Error executing verify-ssh-credentials: {}. Retrying...'.format(e))
await asyncio.sleep(retry_timeout)
if not self.enable_os_upgrade:
config_dict['enable-os-refresh-update'] = False
config_dict['enable-os-upgrade'] = False
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))
self.log.info('New model created, name={}'.format(model_name))
else:
self.log.debug('Model already exists in juju. Getting model {}'.format(model_name))
for machine_id in machines:
try:
await self._juju_destroy_machine(model_name=model_name, machine_id=machine_id)
for machine_id in machines:
try:
await self._juju_destroy_machine(model_name=model_name, machine_id=machine_id)
self.log.debug('destroying model {}...'.format(model_name))
await self.controller.destroy_model(uuid)
self.log.debug('destroying model {}...'.format(model_name))
await self.controller.destroy_model(uuid)
try:
# await self.controller.get_model(uuid)
models = await self.controller.list_models()
if model_name not in models:
self.log.debug('The model {} ({}) was destroyed'.format(model_name, uuid))
return
try:
# await self.controller.get_model(uuid)
models = await self.controller.list_models()
if model_name not in models:
self.log.debug('The model {} ({}) was destroyed'.format(model_name, uuid))
return
- 'connecting to juju controller: {} {}:{} ca_cert: {}'
- .format(self.url, self.username, self.secret, '\n'+self.ca_cert if self.ca_cert else 'None'))
+ 'connecting to juju controller: {} {}:{}{}'
+ .format(self.url, self.username, self.secret[:8] + '...', ' with ca_cert' if self.ca_cert else ''))