def register_machine(self, machine: Machine, db_dict: dict):
try:
entity_id = machine.entity_id
- except:
+ except Exception as e:
# no entity_id aatribute, try machine attribute
entity_id = machine.machine
self.n2vc.debug(msg='Registering machine for changes notifications: {}'.format(entity_id))
url: str,
username: str,
vca_config: dict,
- on_update_db = None
+ on_update_db=None
):
"""Initialize N2VC abstract connector. It defines de API for VCA connectors
if type == 'application' or type == 'unit':
if status in ['waiting', 'maintenance']:
return N2VCDeploymentStatus.RUNNING
+ if status in ['error']:
+ return N2VCDeploymentStatus.FAILED
elif status in ['active']:
return N2VCDeploymentStatus.COMPLETED
elif status in ['blocked']:
total_timeout: float = None
):
- # get juju model
- model = await self._juju_get_model(model_name=model_name)
-
# get the application
application = await self._juju_get_application(model_name=model_name, application_name=application_name)
)
# check if 'verify-ssh-credentials' action exists
- unit = application.units[0]
+ # unit = application.units[0]
actions = await application.get_actions()
if 'verify-ssh-credentials' not in actions:
msg = 'Action verify-ssh-credentials does not exist in application {}'.format(application_name)
+ self.debug(msg=msg)
return False
# execute verify-credentials