Fix bug, check VF is active before destroy 51/1851/1
authormirabal <leonardo.mirabal@altran.com>
Thu, 18 May 2017 12:16:26 +0000 (14:16 +0200)
committermirabal <leonardo.mirabal@altran.com>
Thu, 18 May 2017 12:16:26 +0000 (14:16 +0200)
Change-Id: Id589ab96fad5a4c1af876e03a0f27586b2af7695
Signed-off-by: mirabal <leonardo.mirabal@altran.com>
osm_openvim/host_thread.py

index 1f8fdb4..80d9986 100644 (file)
@@ -1901,7 +1901,8 @@ class host_thread(threading.Thread):
             #TODO.Revise  self.server_forceoff(True)
 
             iface = conn.interfaceLookupByMACString(mac)
-            iface.destroy()
+            if iface.isActive():
+                iface.destroy()
             iface.create()
             self.logger.debug("restore_iface '%s' %s", name, mac)
         except host_thread.lvirt_module.libvirtError as e: