From 76b6b437261a971a0e77658d2884456a262021cf Mon Sep 17 00:00:00 2001 From: brent s Date: Sun, 2 Aug 2020 04:20:15 -0400 Subject: [PATCH] d'oh. can't ref a var before it's defined. --- restart_net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restart_net.py b/restart_net.py index 20d12e1..78c9c55 100755 --- a/restart_net.py +++ b/restart_net.py @@ -44,8 +44,8 @@ class DomainNetwork(object): _netnames = [] for iface in self.dom_xml.xpath('devices/interface'): if iface.attrib.get('type') == 'network': - netname = src_xml.attrib.get('network') src_xml = iface.find('source') + netname = src_xml.attrib.get('network') if src_xml is not None and netname in netnames and not chk: # Why, oh why, does the libvirt API want the XML?? self.ifaces.append(etree.tostring(iface).decode('utf-8'))