X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=rwcm%2Fplugins%2Frwconman%2Frift%2Ftasklets%2Frwconmantasklet%2Fjujuconf.py;h=d64258277857692750484f562bdd20ff3630c809;hb=a3bb91f092d378448cb870eccd45d43865de143c;hp=dce31c3eef2242d9bb720ecf08d8c1fead015f29;hpb=d03647dd8a262a6d944ae6f287f483bb120b7429;p=osm%2FSO.git diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py index dce31c3e..d6425827 100644 --- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py +++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py @@ -42,8 +42,9 @@ class JujuConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): """ Juju implementation of the riftcm_config_plugin.RiftCMConfigPluginBase """ - def __init__(self, dts, log, loop, account): - riftcm_config_plugin.RiftCMConfigPluginBase.__init__(self, dts, log, loop, account) + def __init__(self, dts, log, loop, project, account): + riftcm_config_plugin.RiftCMConfigPluginBase.__init__(self, dts, log, loop, + project, account) self._name = account.name self._type = 'juju' self._ip_address = account.juju.ip_address @@ -182,7 +183,7 @@ class JujuConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): try: path = os.path.join(self._rift_artif_dir, 'launchpad/libs', - agent_vnfr.vnfr_msg.vnfd_ref, + agent_vnfr.vnfr_msg.vnfd.id, 'charms/trusty', charm) self._log.debug("jujuCA: Charm dir is {}".format(path)) @@ -326,15 +327,20 @@ class JujuConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): if parameter.value: val = self.xlate(parameter.value, vnfr['tags']) # TBD do validation of the parameters - data_type = 'string' + data_type = 'STRING' found = False for ca_param in config.parameter: if ca_param.name == parameter.name: data_type = ca_param.data_type found = True break - if data_type == 'integer': - val = int(parameter.value) + try: + if data_type == 'INTEGER': + tmp = int(val) + val = tmp + except Exception as e: + pass + if not found: self._log.warn("jujuCA: Did not find parameter {} for {}". format(parameter, config.name))