aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorÉric Lemoine <elemoine@mirantis.com>2016-02-26 15:48:49 +0100
committerÉric Lemoine <elemoine@mirantis.com>2016-02-26 15:48:51 +0100
commit9544166c4b5ca9dde783af7045dbfc717300a063 (patch)
treec8a82e8341b79420b30971c99acd5369c573eb4c /dev
parent287e4faf99c2fe7a5d0a57334df35a6dc5e71f72 (diff)
downloadkolla-9544166c4b5ca9dde783af7045dbfc717300a063.tar.gz
kolla-9544166c4b5ca9dde783af7045dbfc717300a063.zip
Fix issue in newest_dhcp_lease.py
This fixes a bug in newest_dhcp_lease.py where the get_mac_address function currently searches for a "bridge" interface instead of searching for the interface whose source network is "vagrant-private-dhcp". Change-Id: Iea0b25f893b959b5e319b117e7a1c4c63a00dd23 Closes-Bug: #1548742
Diffstat (limited to 'dev')
-rw-r--r--dev/vagrant/newest_dhcp_lease.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/dev/vagrant/newest_dhcp_lease.py b/dev/vagrant/newest_dhcp_lease.py
index 1ade75bc4..64a8e53da 100644
--- a/dev/vagrant/newest_dhcp_lease.py
+++ b/dev/vagrant/newest_dhcp_lease.py
@@ -36,7 +36,7 @@ import xml.etree.ElementTree as etree
import libvirt
-class NoBridgeInterfaceException(Exception):
+class NoPrivateDHCPInterfaceException(Exception):
pass
@@ -80,14 +80,14 @@ def get_mac_address(conn, domain_name):
interfaces = devices.iterfind('interface')
for interface in interfaces:
- interface_type = interface.get('type')
- if interface_type != 'bridge':
+ source = interface.find('source')
+ if source is None or source.get('network') != 'vagrant-private-dhcp':
continue
mac_element = interface.find('mac')
mac_address = mac_element.get('address')
return mac_address
- raise NoBridgeInterfaceException()
+ raise NoPrivateDHCPInterfaceException()
@libvirt_conn