Change in vdsm[master]: net: api: return networks to connectivity check from setup
phoracek at redhat.com
phoracek at redhat.com
Fri Feb 19 15:12:56 UTC 2016
Petr Horáček has uploaded a new change for review.
Change subject: net: api: return networks to connectivity check from setup
......................................................................
net: api: return networks to connectivity check from setup
Return connectivity_check_networks from network setup, not removal
as we want to move removal to a separate function and it does not
make sense to return created networks from removal function.
Also rename the setup function to fit 'OVS networking code' naming
style.
Change-Id: I57b557442fe6b2324cda19a8d3917cb8221268a7
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M lib/vdsm/network/api.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/53757/1
diff --git a/lib/vdsm/network/api.py b/lib/vdsm/network/api.py
index af85ca0..f645b67 100644
--- a/lib/vdsm/network/api.py
+++ b/lib/vdsm/network/api.py
@@ -694,9 +694,11 @@
ne.ERR_BAD_PARAMS, 'Bond %s does not exist' % bond)
-def _add_missing_networks(configurator, networks, bondings, logger, _netinfo):
+def _networks_setup(configurator, networks, bondings, logger, _netinfo):
# We need to use the newest host info
_netinfo.updateDevices()
+
+ connectivity_check_networks = set()
for network, attrs in networks.iteritems():
if 'remove' in attrs:
@@ -717,6 +719,7 @@
_emergencyNetworkCleanup(network, attrs,
configurator)
raise
+ connectivity_check_networks.add(network)
_netinfo.updateDevices() # Things like a bond mtu can change
@@ -839,7 +842,6 @@
libvirt_nets = netinfo_networks()
_netinfo = CachingNetInfo(_netinfo=netinfo_get(
libvirtNets2vdsm(libvirt_nets)))
- connectivity_check_networks = set()
logger.debug("Applying...")
in_rollback = options.get('_inRollback', False)
@@ -877,13 +879,11 @@
raise ConfigNetworkError(ne.ERR_BAD_BRIDGE, "Cannot delete "
"network %r: It doesn't exist in the "
"system" % network)
- else:
- connectivity_check_networks.add(network)
_handleBondings(bondings, configurator, in_rollback)
- _add_missing_networks(configurator, networks, bondings,
- logger, _netinfo)
+ connectivity_check_networks = _networks_setup(
+ configurator, networks, bondings, logger, _netinfo)
_check_connectivity(connectivity_check_networks, networks, bondings,
options, logger)
--
To view, visit https://gerrit.ovirt.org/53757
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I57b557442fe6b2324cda19a8d3917cb8221268a7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
More information about the vdsm-patches
mailing list