X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=RO-VIM-vmware%2Fosm_rovim_vmware%2Fvimconn_vmware.py;h=f353264eee9ef490ed2262d93776c0e436fc175a;hp=171f7d4451e38102c8c21ea935c8988bcc182f03;hb=3de27d6d03d6e371c385b27354c440bb8c3452fd;hpb=c91896052fa1dd2b68f9023a7f6400f4f5f95308 diff --git a/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py b/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py index 171f7d44..f353264e 100644 --- a/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py +++ b/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py @@ -3720,21 +3720,21 @@ class vimconnector(vimconn.vimconnector): try: content = self.get_network_action(network_uuid=network_uuid) - vm_list_xmlroot = XmlElementTree.fromstring(content) - - network_configuration['status'] = vm_list_xmlroot.get("status") - network_configuration['name'] = vm_list_xmlroot.get("name") - network_configuration['uuid'] = vm_list_xmlroot.get("id").split(":")[3] + if content is not None: + vm_list_xmlroot = XmlElementTree.fromstring(content) - for child in vm_list_xmlroot: - if child.tag.split("}")[1] == 'IsShared': - network_configuration['isShared'] = child.text.strip() - if child.tag.split("}")[1] == 'Configuration': - for configuration in child.iter(): - tagKey = configuration.tag.split("}")[1].strip() - if tagKey != "": - network_configuration[tagKey] = configuration.text.strip() - return network_configuration + network_configuration['status'] = vm_list_xmlroot.get("status") + network_configuration['name'] = vm_list_xmlroot.get("name") + network_configuration['uuid'] = vm_list_xmlroot.get("id").split(":")[3] + + for child in vm_list_xmlroot: + if child.tag.split("}")[1] == 'IsShared': + network_configuration['isShared'] = child.text.strip() + if child.tag.split("}")[1] == 'Configuration': + for configuration in child.iter(): + tagKey = configuration.tag.split("}")[1].strip() + if tagKey != "": + network_configuration[tagKey] = configuration.text.strip() except Exception as exp : self.logger.debug("get_vcd_network: Failed with Exception {}".format(exp)) raise vimconn.vimconnException("get_vcd_network: Failed with Exception {}".format(exp))