d'oh. can't ref a var before it's defined.

This commit is contained in:
brent s. 2020-08-02 04:20:15 -04:00
parent d15510e2b4
commit 76b6b43726
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -44,8 +44,8 @@ class DomainNetwork(object):
_netnames = [] _netnames = []
for iface in self.dom_xml.xpath('devices/interface'): for iface in self.dom_xml.xpath('devices/interface'):
if iface.attrib.get('type') == 'network': if iface.attrib.get('type') == 'network':
netname = src_xml.attrib.get('network')
src_xml = iface.find('source') src_xml = iface.find('source')
netname = src_xml.attrib.get('network')
if src_xml is not None and netname in netnames and not chk: if src_xml is not None and netname in netnames and not chk:
# Why, oh why, does the libvirt API want the XML?? # Why, oh why, does the libvirt API want the XML??
self.ifaces.append(etree.tostring(iface).decode('utf-8')) self.ifaces.append(etree.tostring(iface).decode('utf-8'))