Change in vdsm[master]: config: rename net_persistence

danken at redhat.com danken at redhat.com
Sun Dec 22 02:22:31 UTC 2013


Dan Kenigsberg has uploaded a new change for review.

Change subject: config: rename net_persistence
......................................................................

config: rename net_persistence

'persistence' is a too-generic name for a configurable controlling the
persistence method of network definitions. 'net_persistence' would be a
more appropriate name. Let us rename this one quickly before anyone
starts to use the current name.

Change-Id: Ief0ce67962f705fcba9ed556d87a871c24f50e61
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/config.py.in
M lib/vdsm/netconfpersistence.py
M lib/vdsm/netinfo.py
M lib/vdsm/tool/unified_persistence.py
M tests/functional/utils.py
M vdsm/configNetwork.py
M vdsm/netconf/ifcfg.py
M vdsm/vdsm-restore-net-config
8 files changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/22611/1

diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 75cd119..f5865c1 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -46,7 +46,7 @@
             'Whether to use "ifcfg" or "iproute2" to configure networks. '
             'iproute2 configurator is not ready yet for genral usage.'),
 
-        ('persistence', 'ifcfg',
+        ('net_persistence', 'ifcfg',
             'Whether to use "ifcfg" or "unified" persistence for networks.'),
 
         ('nic_model', 'rtl8139,pv',
diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py
index 8de3c70..d400df6 100644
--- a/lib/vdsm/netconfpersistence.py
+++ b/lib/vdsm/netconfpersistence.py
@@ -188,7 +188,7 @@
 
     def store(self):
         utils.execCmd([constants.EXT_VDSM_STORE_NET_CONFIG,
-                       config.get('vars', 'persistence')])
+                       config.get('vars', 'net_persistence')])
         return PersistentConfig()
 
 
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index d000fe4..6d0c5ff 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -421,7 +421,7 @@
 
 def getBootProtocol(iface, persistence=None):
     if persistence is None:
-        persistence = config.get('vars', 'persistence')
+        persistence = config.get('vars', 'net_persistence')
 
     if persistence == 'ifcfg':
         return getIfaceCfg(iface).get('BOOTPROTO')
diff --git a/lib/vdsm/tool/unified_persistence.py b/lib/vdsm/tool/unified_persistence.py
index d1b3d0a..66022dd 100644
--- a/lib/vdsm/tool/unified_persistence.py
+++ b/lib/vdsm/tool/unified_persistence.py
@@ -133,7 +133,7 @@
 
 
 def isNeeded():
-    return config.get('vars', 'persistence') == 'unified'
+    return config.get('vars', 'net_persistence') == 'unified'
 
 
 @expose('upgrade-to-unified-persistence')
diff --git a/tests/functional/utils.py b/tests/functional/utils.py
index 20fb62d..4f82a45 100644
--- a/tests/functional/utils.py
+++ b/tests/functional/utils.py
@@ -70,7 +70,7 @@
         self.vdscli = vdscli.connect()
         self.netinfo = \
             netinfo.NetInfo(self.vdscli.getVdsCapabilities()['info'])
-        if config.get('vars', 'persistence') == 'unified':
+        if config.get('vars', 'net_persistence') == 'unified':
             self.config = RunningConfig()
         else:
             self.config = None
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 1afa97b..3e62f7f 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -182,7 +182,7 @@
 
     @wraps(func)
     def wrapped(*args, **kwargs):
-        if not config.get('vars', 'persistence') == 'unified':
+        if not config.get('vars', 'net_persistence') == 'unified':
             return func(*args, **kwargs)
 
         # Get args and kwargs in a single dictionary
@@ -654,7 +654,7 @@
 def setSafeNetworkConfig():
     """Declare current network configuration as 'safe'"""
     execCmd([constants.EXT_VDSM_STORE_NET_CONFIG,
-             config.get('vars', 'persistence')])
+             config.get('vars', 'net_persistence')])
 
 
 def usage():
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 46df9f9..52b95b1 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -47,7 +47,7 @@
     def __init__(self, inRollback=False):
         super(Ifcfg, self).__init__(ConfigWriter(), inRollback)
         self.unifiedPersistence = \
-            config.get('vars', 'persistence') == 'unified'
+            config.get('vars', 'net_persistence') == 'unified'
         if self.unifiedPersistence:
             self.runningConfig = RunningConfig()
 
@@ -292,7 +292,7 @@
 
     def _networkBackup(self, network):
         self._atomicNetworkBackup(network)
-        if config.get('vars', 'persistence') != 'unified':
+        if config.get('vars', 'net_persistence') != 'unified':
             self._persistentNetworkBackup(network)
 
     def _atomicNetworkBackup(self, network):
@@ -334,7 +334,7 @@
 
     def _backup(self, filename):
         self._atomicBackup(filename)
-        if config.get('vars', 'persistence') != 'unified':
+        if config.get('vars', 'net_persistence') != 'unified':
             self._persistentBackup(filename)
 
     def _atomicBackup(self, filename):
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 0f4cbf1..fc2308b 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -61,7 +61,7 @@
 
 
 def restore():
-    if config.get('vars', 'persistence') == 'unified':
+    if config.get('vars', 'net_persistence') == 'unified':
         unified_restoration()
     else:
         ifcfg_restoration()


-- 
To view, visit http://gerrit.ovirt.org/22611
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief0ce67962f705fcba9ed556d87a871c24f50e61
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list