Fix merge conflicts 29/929/1
authorPhilip Joseph <philip.joseph@riftio.com>
Thu, 12 Jan 2017 09:16:22 +0000 (09:16 +0000)
committerPhilip Joseph <philip.joseph@riftio.com>
Thu, 12 Jan 2017 09:16:22 +0000 (09:16 +0000)
Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
BUILD.sh
examples/ping_pong_ns/rift/mano/examples/ping_pong_nsd.py
models/plugins/yang/rw-vnfd.yang
models/plugins/yang/rw-vnfr.yang
models/plugins/yang/vnfd.yang
rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py
rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py
rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py
rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py

index 788f9d1..2e3ba89 100755 (executable)
--- a/BUILD.sh
+++ b/BUILD.sh
@@ -172,7 +172,11 @@ fi
 # and install of the packages required to build and run
 # this module
 if $runMkcontainer; then
-    sudo apt-get install -y libxml2-dev libxslt-dev
+    if [[ $PLATFORM == ub16 ]]; then
+        sudo apt-get install -y libxml2-dev libxslt-dev python3-crypto
+    elif [[ $PLATFORM == fc20 ]]; then
+        sudo yum-install --assumeyes libxml2-devel libxslt-devel python3-crypto
+    fi
     sudo /usr/rift/container_tools/mkcontainer --modes build --modes ext --repo ${PLATFORM_REPOSITORY}
     sudo pip3 install lxml==3.4.0
 fi
index 4a16c7a..3953787 100755 (executable)
@@ -1520,6 +1520,13 @@ def generate_ping_pong_descriptors(fmt="json",
     for i in range(external_vlr_count):
         cpgroup_list.append([])
 
+    if use_charm:
+        use_vca_conf = True
+
+    if use_vca_conf:
+        use_ns_init_conf = True
+        use_vnf_init_conf = False
+
     suffix = ''
     ping = VirtualNetworkFunction("ping_vnfd%s" % (suffix), pingcount)
     ping.use_vnf_init_conf = use_vnf_init_conf
index 29eb852..456a667 100644 (file)
@@ -113,5 +113,14 @@ module rw-vnfd
       }
     }
   }
+
+  augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:mgmt-interface {
+    leaf ssh-key {
+      description
+        "Whether SSH keys need to be generated and passed
+             to the RO and VCA during instantiation.";
+      type boolean;
+    }
+  }
 }
 // vim: sw=2
index be8acb4..7394706 100644 (file)
@@ -296,6 +296,23 @@ module rw-vnfr
     uses vnfd-ref-count;
   }
 
+  augment /vnfr:vnfr-catalog/vnfr:vnfr/vnfr:vnfd/vnfr:mgmt-interface {
+    leaf ssh-key {
+      description
+        "Whether SSH keys need to be generated and passed
+             to the RO and VCA during instantiation.";
+      type boolean;
+    }
+  }
+
+  augment /vnfr:vnfr-catalog/vnfr:vnfr/vnfr:vnfd {
+    leaf meta {
+      description
+        "Any meta-data needed by the UI";
+      type string;
+    }
+  }
+
   container vnfr-console {
     config false;
     list vnfr {
index d47472d..75de5e3 100644 (file)
@@ -342,13 +342,6 @@ module vnfd
           type inet:port-number;
         }
 
-        leaf ssh-key {
-          description
-            "Whether SSH keys need to be generated and passed
-             to the RO and VCA during instantiation.";
-          type boolean;
-        }
-
         container dashboard-params {
           description "Parameters for the VNF dashboard";
 
index cda6e90..6987128 100644 (file)
@@ -1182,13 +1182,7 @@ class ConfigManagerConfig(object):
 
         vnfr_name = vnfr.name
 
-        vnfd = yield from self.cmdts_obj.get_vnfd(vnfr.vnfd_ref)
-        if vnfd is None:
-            msg = "VNFR {}, unable to get VNFD {}". \
-                  format(vnfr_name, vnfr.vnfd_ref)
-            self._log.error(msg)
-            raise InitialConfigError(msg)
-
+        vnfd = vnfr.vnfd
         vnf_cfg = vnfd.vnf_configuration
 
         for conf in vnf_cfg.initial_config_primitive:
index 31b0544..431be98 100644 (file)
@@ -323,7 +323,7 @@ class OpenmanoNsr(object):
             self._log.debug("Key pair  NSD  is %s",authorized_key)
             key_pairs.append(authorized_key.key)
 
-        if self._ssh_key:
+        if self._ssh_key['public_key']:
             self._log.debug("Pub key  NSD  is %s", self._ssh_key['public_key'])
             key_pairs.append(self._ssh_key['public_key'])
 
index c9f7bb9..84fd3d3 100755 (executable)
@@ -964,9 +964,9 @@ class VirtualNetworkFunctionRecord(object):
 
         vnfr = RwVnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr.from_dict(vnfr_dict)
 
-        vnfr.vnfd = VnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_Vnfd.from_dict(
-            self.vnfd.as_dict(),
-            ignore_missing_keys=True)
+        vnfr.vnfd = RwVnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_Vnfd.from_dict(
+            self.vnfd.as_dict())
+
         vnfr.member_vnf_index_ref = self.member_vnf_index
         vnfr.vnf_configuration.from_dict(self._vnfd.vnf_configuration.as_dict())
 
@@ -3972,8 +3972,11 @@ class NsManager(object):
                                    )
         self._nsrs[nsr_msg.id] = nsr
 
-        # Generate ssh key pair if required
-        yield from nsr.generate_ssh_key_pair(config_xact)
+        try:
+            # Generate ssh key pair if required
+            yield from nsr.generate_ssh_key_pair(config_xact)
+        except Exception as e:
+            self._log.exception("SSH key: {}".format(e))
 
         self._log.debug("NSR {}: SSh key generated: {}".format(nsr_msg.name,
                                                                nsr.public_key))
@@ -4002,7 +4005,11 @@ class NsManager(object):
             raise NetworkServiceRecordError(err)
 
         nsr = self._nsrs[nsr_id]
-        yield from nsr.nsm_plugin.instantiate_ns(nsr, config_xact)
+        try:
+            yield from nsr.nsm_plugin.instantiate_ns(nsr, config_xact)
+        except Exception as e:
+            self._log.exception("NS instantiate: {}".format(e))
+            raise e
 
     @asyncio.coroutine
     def update_vnfr(self, vnfr):
index d3cef3e..65f5575 100755 (executable)
@@ -1385,7 +1385,7 @@ class VirtualNetworkFunctionRecord(object):
         vnfr_dict.update(vnfd_copy_dict)
 
         vnfr_msg = RwVnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr.from_dict(vnfr_dict)
-        vnfr_msg.vnfd = VnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_Vnfd.from_dict(self.vnfd.as_dict())
+        vnfr_msg.vnfd = RwVnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_Vnfd.from_dict(self.vnfd.as_dict())
 
         vnfr_msg.create_time = self._create_time
         vnfr_msg.uptime = int(time.time()) - self._create_time