Change-Id: Ia81b37958ab03630cf9f3c65ab1ec59a95f82d68
Signed-off-by: quilesj <e.nvi001.tid@telefonica.com>
def register_machine(self, machine: Machine, db_dict: dict):
try:
entity_id = machine.entity_id
def register_machine(self, machine: Machine, db_dict: dict):
try:
entity_id = machine.entity_id
# no entity_id aatribute, try machine attribute
entity_id = machine.machine
self.n2vc.debug(msg='Registering machine for changes notifications: {}'.format(entity_id))
# 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,
url: str,
username: str,
vca_config: dict,
):
"""Initialize N2VC abstract connector. It defines de API for VCA connectors
):
"""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 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']:
elif status in ['active']:
return N2VCDeploymentStatus.COMPLETED
elif status in ['blocked']:
total_timeout: float = None
):
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)
# get the application
application = await self._juju_get_application(model_name=model_name, application_name=application_name)
)
# check if 'verify-ssh-credentials' action exists
)
# 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)
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)
return False
# execute verify-credentials
return False
# execute verify-credentials