Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netconf: privatize inRollback and use it for persistent rollback
......................................................................
netconf: privatize inRollback and use it for persistent rollback
inRollback is not part of the external setupNetworks api. Thus, it
is wise to be coherent and prefix it with '_'. Additionally, make
the persistent network restoration script use it.
Change-Id: I6bcf98cb587c99366173d0a2994444b6370c9778
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/API.py
M vdsm/configNetwork.py
M vdsm/vdsm-restore-net-config
3 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/21868/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 86413c3..19a8f20 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1394,7 +1394,7 @@
def _rollback(self, config, excType, value, tb):
try:
supervdsm.getProxy().setupNetworks(
- config.nets, config.bonds, {'inRollback': True,
+ config.nets, config.bonds, {'_inRollback': True,
'connectivityCheck': 0})
except Exception as rollbackError:
self.log.error('Memory rollback failed: %e', rollbackError,
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 3afcb4e..5fdd696 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -537,7 +537,7 @@
force=0|1
connectivityCheck=0|1
connectivityTimeout=<int>
- inRollback=True|False
+ _inRollback=True|False
Notes:
When you edit a network that is attached to a bonding, it's not
@@ -561,7 +561,7 @@
hooks.before_network_setup()
logger.debug("Applying...")
- with Ifcfg(options.get('inRollback', False)) as configurator:
+ with Ifcfg(options.get('_inRollback', False)) as configurator:
libvirt_nets = netinfo.networks()
# Remove edited networks and networks with 'remove' attribute
for network, networkAttrs in networks.items():
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 29b2a8d..4227e4e 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -48,7 +48,8 @@
removeBonds[bond] = {'remove': True}
logging.debug('Removing all networks (%s) and bonds (%s) in running '
'config.', removeNetworks, removeBonds)
- setupNetworks(removeNetworks, removeBonds, connectivityCheck=False)
+ setupNetworks(removeNetworks, removeBonds, connectivityCheck=False,
+ _inRollback=True)
configurator.flush()
persistentConfig = PersistentConfig()
@@ -56,7 +57,7 @@
bonds = persistentConfig.bonds
logging.debug('Calling setupNetworks with networks (%s) and bond (%s).',
nets, bonds)
- setupNetworks(nets, bonds, connectivityCheck=False)
+ setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True)
def restore():
--
To view, visit
http://gerrit.ovirt.org/21868
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6bcf98cb587c99366173d0a2994444b6370c9778
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>