raise e
# return public key if exists
- return output
+ return output["pubkey"] if "pubkey" in output else output
async def add_relation(
self,
:return: app-vnf-<vnf id>-vdu-<vdu-id>-cnt-<vdu-count>
"""
+ # TODO: Enforce the Juju 50-character application limit
+
# split namespace components
_, _, vnf_id, vdu_id, vdu_count = self._get_namespace_components(namespace=namespace)
if vnf_id is None or len(vnf_id) == 0:
vnf_id = ''
else:
- vnf_id = 'vnf-' + vnf_id
+ # Shorten the vnf_id to its last twelve characters
+ vnf_id = 'vnf-' + vnf_id[-12:]
if vdu_id is None or len(vdu_id) == 0:
vdu_id = ''
else:
- vdu_id = '-vdu-' + vdu_id
+ # Shorten the vdu_id to its last twelve characters
+ vdu_id = '-vdu-' + vdu_id[-12:]
if vdu_count is None or len(vdu_count) == 0:
vdu_count = ''
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