Change in vdsm[master]: netinfo: bootproto4 is now 'dhcp'/'none' instead of a boolean
osvoboda at redhat.com
osvoboda at redhat.com
Thu Feb 27 14:30:47 UTC 2014
Ondřej Svoboda has uploaded a new change for review.
Change subject: netinfo: bootproto4 is now 'dhcp'/'none' instead of a boolean
......................................................................
netinfo: bootproto4 is now 'dhcp'/'none' instead of a boolean
testSetupNetworksAddDelDhcp verifies the new property.
Change-Id: Iaef31f93da978a5793fceae28763ceafedb8d3b6
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
---
M lib/vdsm/netinfo.py
M tests/functional/networkTests.py
2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/25170/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index d7eccc6..510ac85 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -500,9 +500,11 @@
Raises a KeyError if the iface does not exist.'''
data = {}
try:
+ bootproto4 = 'dhcp' if iface in dhcp4 else 'none'
if bridged:
data.update({'ports': ports(iface), 'stp': bridge_stp_state(iface),
'cfg': getIfaceCfg(iface)})
+ data['cfg']['BOOTPROTO'] = bootproto4
else:
# ovirt-engine-3.1 expects to see the "interface" attribute iff the
# network is bridgeless. Please remove the attribute and this
@@ -512,7 +514,7 @@
ipv4addr, ipv4netmask, ipv6addrs = getIpInfo(iface, ipaddrs)
data.update({'iface': iface, 'bridged': bridged,
'addr': ipv4addr, 'netmask': ipv4netmask,
- 'bootproto4': iface in dhcp4,
+ 'bootproto4': bootproto4,
'gateway': getgateway(gateways, iface),
'ipv6addrs': ipv6addrs,
'ipv6gateway': ipv6routes.get(iface, '::'),
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 695a29f..ec4fb1c 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -1661,12 +1661,15 @@
veth.setLinkUp(left)
with dnsmasqDhcp(left):
network = {NETWORK_NAME: {'nic': right, 'bridged': False,
- 'bootprot': 'dhcp'}}
+ 'bootproto': 'dhcp'}}
status, msg = self.vdsm_net.setupNetworks(network, {}, NOCHK)
self.assertEqual(status, SUCCESS, msg)
self.assertNetworkExists(NETWORK_NAME)
+ net = self.vdsm_net.netinfo.networks[NETWORK_NAME]
+ self.assertEqual(net['bootproto4'], 'dhcp')
+
network = {NETWORK_NAME: {'remove': True}}
status, msg = self.vdsm_net.setupNetworks(network, {}, NOCHK)
self.assertEqual(status, SUCCESS, msg)
--
To view, visit http://gerrit.ovirt.org/25170
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaef31f93da978a5793fceae28763ceafedb8d3b6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
More information about the vdsm-patches
mailing list