Merge from OSM SO master
[osm/SO.git] / rwcm / plugins / rwconman / rift / tasklets / rwconmantasklet / jujuconf.py
index dce31c3..d642582 100644 (file)
@@ -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))