return self._api
@property
+ def agent_data(self):
+ return dict(
+ type=self.agent_type,
+ name=self.name,
+ host=self._ip_address,
+ port=self._port,
+ user=self._user,
+ secret=self._secret
+ )
+
def vnfr(self, vnfr_id):
try:
vnfr = self._juju_vnfs[vnfr_id].vnfr
return vnfr
+ def get_service_name(self, vnfr_id):
+ vnfr = self.vnfr(vnfr_id)
+ if vnfr and 'vnf_juju_name' in vnfr:
+ return vnfr['vnf_juju_name']
+ return None
+
def juju_log(self, level, name, log_str, *args):
if name is not None:
g_log_str = 'jujuCA:({}) {}'.format(name, log_str)
self._log.info("jujuCA:(%s) Action %s with params %s",
vnfr['vnf_juju_name'], action, params)
- resp = yield from self.api.execute_actions(action, params,
- service=service)
+ resp = yield from self.api.execute_action(action, params,
+ service=service)
if 'error' in resp:
- self._log.error("Applying initial config failed: {}".
- format(resp))
+ self._log.error("Applying initial config failed for {} with {}: {}".
+ format(action, params, resp))
return False
action_ids.append(resp['action']['tag'])
while pending:
pending = False
for act in action_ids:
- resp = yield from self.api.get_action_status(act, service=service)
+ resp = yield from self.api.get_action_status(act)
if 'error' in resp:
self._log.error("Initial config failed: {}".format(resp))
return False
'''
try:
- return self.api._get_action_status(execution_id)
+ self._log.debug("jujuCA: Get action status for {}".format(execution_id))
+ resp = self.api._get_action_status(execution_id)
+ self._log.debug("jujuCA: Action status: {}".format(resp))
+ return resp
except Exception as e:
self._log.error("jujuCA: Error fetching execution status for %s",
execution_id)