# 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
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
}
}
}
+
+ 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
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 {
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";
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:
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'])
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())
)
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))
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):
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