From: Philip Joseph Date: Wed, 22 Mar 2017 20:42:02 +0000 (+0530) Subject: Use updated platform capabilites X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F1351%2F1;p=osm%2FSO.git Use updated platform capabilites Signed-off-by: Philip Joseph --- diff --git a/common/python/rift/mano/utils/project.py b/common/python/rift/mano/utils/project.py index 56778a9a..de495e9a 100644 --- a/common/python/rift/mano/utils/project.py +++ b/common/python/rift/mano/utils/project.py @@ -396,7 +396,7 @@ class ProjectConfigCallbacks(object): class ProjectDtsHandler(object): - XPATH = "C,{}/config".format(XPATH) + XPATH = "C,{}/project-config".format(XPATH) def __init__(self, dts, log, callbacks): self._dts = dts @@ -510,7 +510,7 @@ class ProjectDtsHandler(object): # 'delete': [], # }) - self._log.error("prepare msg type {}".format(type(msg))) + # self._log.error("prepare msg type {}".format(type(msg))) name = msg.name_ref self._log.debug("Project %s on_prepare config received (action: %s): %s", diff --git a/models/plugins/yang/rw-project-mano.yang b/models/plugins/yang/rw-project-mano.yang index 0b5a3341..8cf09248 100644 --- a/models/plugins/yang/rw-project-mano.yang +++ b/models/plugins/yang/rw-project-mano.yang @@ -37,7 +37,7 @@ module rw-project-mano "Derived from earlier versions of base YANG files"; } - augment /rw-project:project/rw-project:config { + augment /rw-project:project/rw-project:project-config { leaf name-ref { type leafref { path "../../rw-project:name"; diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py index 139302bd..804439fc 100755 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py @@ -650,7 +650,7 @@ class VirtualLinkRecord(object): for conn in self.vld_msg.vnfd_connection_point_ref: for vnfr in vnfrs: if (vnfr.vnfd.id == conn.vnfd_id_ref and - str(vnfr.member_vnf_index) == conn.member_vnf_index_ref and + vnfr.member_vnf_index == conn.member_vnf_index_ref and self.cloud_account_name == vnfr.cloud_account_name and self.om_datacenter_name == vnfr.om_datacenter_name): cp_entry = nsr_vlr.vnfr_connection_point_ref.add() @@ -985,7 +985,7 @@ class VirtualNetworkFunctionRecord(object): vnfr.vnfd = VnfrYang.YangData_RwProject_Project_VnfrCatalog_Vnfr_Vnfd. \ from_dict(self.vnfd.as_dict(), ignore_missing_keys=True) - vnfr.member_vnf_index_ref = str(self.member_vnf_index) + vnfr.member_vnf_index_ref = self.member_vnf_index vnfr.vnf_configuration.from_dict(self._vnfd.vnf_configuration.as_dict()) if self._vnfd.mgmt_interface.has_field("port"): diff --git a/rwlaunchpad/test/launchpad.py b/rwlaunchpad/test/launchpad.py index 5b40b906..c299311b 100755 --- a/rwlaunchpad/test/launchpad.py +++ b/rwlaunchpad/test/launchpad.py @@ -422,10 +422,11 @@ class Demo(rift.vcs.demo.Demo): GlanceServer(), rift.vcs.DtsRouterTasklet(), rift.vcs.MsgBrokerTasklet(), - #rift.vcs.RestPortForwardTasklet(), rift.vcs.RestconfTasklet(), rift.vcs.RiftCli(), rift.vcs.uAgentTasklet(), + rift.vcs.IdentityManagerTasklet(), + rift.vcs.ProjectManagerTasklet(), rift.vcs.Launchpad(), ] @@ -481,6 +482,16 @@ class Demo(rift.vcs.demo.Demo): stby_lp_vm.add_tasklet(rift.vcs.uAgentTasklet(), mode_active=False) colony.append(stby_lp_vm) + if ha_mode == "LSS": + stby_lp_vm_2 = rift.vcs.VirtualMachine( + name='launchpad-vm-3', + ip=mgmt_ip_list[2], + procs=standby_procs, + start=False, + ) + stby_lp_vm_2.add_tasklet(rift.vcs.uAgentTasklet(), mode_active=False) + colony.append(stby_lp_vm_2) + sysinfo = rift.vcs.SystemInfo( mode='ethsim', zookeeper=rift.vcs.manifest.RaZookeeper(master_ip=mgmt_ip_list[0]), @@ -568,14 +579,24 @@ def main(argv=sys.argv[1:]): #load demo info and create Demo object demo = Demo(args.no_ui, ha_mode, mgmt_ip_list, args.test_name) - # Create the prepared system from the demo - system = rift.vcs.demo.prepared_system_from_demo_and_args(demo, args, - northbound_listing=["cli_launchpad_schema_listing.txt"], - netconf_trace_override=True) - + system = rift.vcs.demo.prepared_system_from_demo_and_args( + demo, args, + northbound_listing=["platform_schema_listing.txt", + "platform_mgmt_schema_listing.txt", + "cli_launchpad_schema_listing.txt"], + netconf_trace_override=True) + + # Search for externally accessible IP address with netifaces + gateways = netifaces.gateways() + # Check for default route facing interface and then get its ip address + if 'default' in gateways: + interface = gateways['default'][netifaces.AF_INET][1] + confd_ip = netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr'] + else: + # no default gateway. Revert to 127.0.0.1 + confd_ip = "127.0.0.1" # TODO: This need to be changed when launchpad starts running on multiple VMs - # confd_ip = socket.gethostbyname(socket.gethostname()) - rift.vcs.logger.configure_sink(config_file=None, confd_ip="127.0.0.1") + rift.vcs.logger.configure_sink(config_file=None, confd_ip=confd_ip) # Start the prepared system system.start() @@ -583,6 +604,7 @@ def main(argv=sys.argv[1:]): if __name__ == "__main__": resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY) ) + os.system('/usr/rift/bin/UpdateHostsFile') try: main() except rift.vcs.demo.ReservationError: