Change in vdsm[master]: net: Fixing old netinfo access
edwardh at redhat.com
edwardh at redhat.com
Tue Feb 2 21:31:33 UTC 2016
Edward Haas has uploaded a new change for review.
Change subject: net: Fixing old netinfo access
......................................................................
net: Fixing old netinfo access
netinfo has been split into individual modules some time ago, this patch
fixes some leftovers that have been missed.
Change-Id: I37b61668eb8bda5a67b60e0d6b8ea92b524e8b45
Signed-off-by: Edward Haas <edwardh at redhat.com>
---
M vdsm/virt/vmdevices/graphics.py
M vdsm_hooks/ethtool_options/ethtool_options.py
M vdsm_hooks/extra_ipv4_addrs/extra_ipv4_addrs.py
M vdsm_hooks/ovs/ovs_before_network_setup_mtu.py
4 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/53011/1
diff --git a/vdsm/virt/vmdevices/graphics.py b/vdsm/virt/vmdevices/graphics.py
index 86301cd..478c853 100644
--- a/vdsm/virt/vmdevices/graphics.py
+++ b/vdsm/virt/vmdevices/graphics.py
@@ -206,7 +206,7 @@
try:
nets = netinfo.networks()
device = nets[network].get('iface', network)
- ip, _, _, _ = netinfo.getIpInfo(device)
+ ip, _, _, _ = netinfo.addresses.getIpInfo(device)
except (libvirt.libvirtError, KeyError, IndexError):
ip = config.get('addresses', 'guests_gateway_ip')
if ip == '':
diff --git a/vdsm_hooks/ethtool_options/ethtool_options.py b/vdsm_hooks/ethtool_options/ethtool_options.py
index 29b2807..d3c2fe3 100644
--- a/vdsm_hooks/ethtool_options/ethtool_options.py
+++ b/vdsm_hooks/ethtool_options/ethtool_options.py
@@ -119,7 +119,7 @@
def _net_nics(attrs):
if 'bonding' in attrs:
- return netinfo.slaves(attrs['bonding'])
+ return netinfo.bonding.slaves(attrs['bonding'])
else:
return [attrs.pop('nic')] if 'nic' in attrs else ()
diff --git a/vdsm_hooks/extra_ipv4_addrs/extra_ipv4_addrs.py b/vdsm_hooks/extra_ipv4_addrs/extra_ipv4_addrs.py
index bcef83e..07f562b 100644
--- a/vdsm_hooks/extra_ipv4_addrs/extra_ipv4_addrs.py
+++ b/vdsm_hooks/extra_ipv4_addrs/extra_ipv4_addrs.py
@@ -68,7 +68,7 @@
if utils.tobool(attrs.get('bridged')):
return network
# bridgeless
- nics, vlan, _, bonding = netinfo.NetInfo().\
+ nics, vlan, _, bonding = netinfo.cache.CachingNetInfo().\
getNicsVlanAndBondingForNetwork(network)
return vlan or bonding or nics[0]
diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_mtu.py b/vdsm_hooks/ovs/ovs_before_network_setup_mtu.py
index 10cc23b..c5f951c 100644
--- a/vdsm_hooks/ovs/ovs_before_network_setup_mtu.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup_mtu.py
@@ -30,7 +30,7 @@
def _update_mtu_changes(mtu, devices, changes):
for device in devices:
- current_mtu = netinfo.getMtu(device)
+ current_mtu = netinfo.mtus.getMtu(device)
mtu = max(mtu, changes.get(device), current_mtu)
if mtu != current_mtu:
changes[device] = mtu
@@ -59,8 +59,8 @@
changes = {}
for bonding, attrs in iter_ovs_bonds(running_config.bonds):
slaves = running_config.bonds[bonding].get('nics')
- mtu = max(netinfo.getMtu(bonding),
- max([netinfo.getMtu(slave) for slave in slaves]))
+ mtu = max(netinfo.mtus.getMtu(bonding),
+ max([netinfo.mtus.getMtu(slave) for slave in slaves]))
_update_mtu_changes(mtu, slaves, changes)
return changes
@@ -75,7 +75,7 @@
for net, attrs in iter_ovs_nets(running_config.networks):
mtu = attrs.get('mtu')
if mtu is not None and 'vlan' in attrs:
- current_mtu = netinfo.getMtu(net)
+ current_mtu = netinfo.mtus.getMtu(net)
if current_mtu != mtu:
changes[net] = mtu
return changes
--
To view, visit https://gerrit.ovirt.org/53011
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I37b61668eb8bda5a67b60e0d6b8ea92b524e8b45
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>
More information about the vdsm-patches
mailing list