- except KeyError as e:
- self._log.exception("jujuCA:(%s) Initial config error(%s): config=%s",
- vnfr['vnf_juju_name'], str(e), config)
- config = None
- return False
-
- if config:
- self.juju_log('info', vnfr['vnf_juju_name'],
- "Applying Initial config:%s",
- config)
-
- rc = yield from self.api.apply_config(config, service=service)
- if rc is False:
- self.log.error("Service {} is in error state".format(service))
- return False
-
-
- # Apply any actions specified as part of initial config
- for primitive in vnfr['config'].initial_config_primitive:
- if primitive.name != 'config':
- self._log.debug("jujuCA:(%s) Initial config action primitive %s",
- vnfr['vnf_juju_name'], primitive)
- action = primitive.name
- params = {}
- for param in primitive.parameter:
- val = self.xlate(param.value, vnfr['tags'])
- params.update({param.name: val})
-
- self._log.info("jujuCA:(%s) Action %s with params %s",
- vnfr['vnf_juju_name'], action, params)
-
- resp = yield from self.api.execute_action(action, params,
- service=service)
- if 'error' in resp:
- self._log.error("Applying initial config on {} failed for {} with {}: {}".
- format(vnfr['vnf_juju_name'], action, params, resp))
- return False
-
- action_ids.append(resp['action']['tag'])