Small change in refresh_vms_status to get network_name 60/6160/1
authorkasar <pkasar@vmware.com>
Thu, 17 May 2018 09:44:39 +0000 (02:44 -0700)
committerkasar <pkasar@vmware.com>
Thu, 17 May 2018 09:44:51 +0000 (02:44 -0700)
Change-Id: I602cb0342199e7e0d4e84f2c05377f0d22035f54
Signed-off-by: kasar <pkasar@vmware.com>
osm_ro/vimconn_vmware.py

index e24082c..733cf65 100644 (file)
@@ -2269,7 +2269,9 @@ class vimconnector(vimconn.vimconnector):
                                 if vm_mac is not None:
                                     vm_ip = self.get_ipaddr_from_NSXedge(nsx_edge_list, vm_mac)
 
-                            network_name = vm.NetworkConnectionSection.NetworkConnection.get('network')
+                            net_s = re.search('network="(.*?)"',network)
+                            network_name = net_s.group(1) if net_s else None
+
                             vm_net_id = self.get_network_id_by_name(network_name)
                             interface = {"mac_address": vm_mac,
                                          "vim_net_id": vm_net_id,