From 6006554ad15e34db86106436bab7bbd554c5788c Mon Sep 17 00:00:00 2001 From: brent s Date: Sun, 2 Aug 2020 03:51:51 -0400 Subject: [PATCH] fix lxml warning --- restart_net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restart_net.py b/restart_net.py index 5c227a2..db14233 100755 --- a/restart_net.py +++ b/restart_net.py @@ -37,7 +37,7 @@ class DomainNetwork(object): for iface in self.dom_xml.xpath('devices/interface'): if iface.attrib.get('type') == 'network': src_xml = iface.find('source') - if src_xml and src_xml.attrib.get('network') in netnames: + if src_xml is not None and src_xml.attrib.get('network') in netnames: # Why, oh why, does the libvirt API want the XML?? self.ifaces.append(etree.tostring(iface).decode('utf-8')) return(None)