Dan Kenigsberg has uploaded a new change for review.
Change subject: netconf.ifcfg: include CONFFILE_HEADER in route/rule files
......................................................................
netconf.ifcfg: include CONFFILE_HEADER in route/rule files
Include the
# Generated by VDSM version x.y.z
header in all vdsm-written ifcfg files.
Change-Id: Ia49754b85797168df056ebd9acf81c151ad3980f
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/netconf/ifcfg.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/24103/1
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 0bc1b96..47354e4 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -515,6 +515,7 @@
'''Backs up the previous contents of the file referenced by fileName
writes the new configuration and sets the specified access mode.'''
self._backup(fileName)
+ configuration = self.CONFFILE_HEADER + '\n' + configuration
logging.debug('Writing to file %s configuration:\n%s' % (fileName,
configuration))
with open(fileName, 'w') as confFile:
@@ -534,9 +535,8 @@
def _createConfFile(self, conf, name, ipconfig, mtu=None, **kwargs):
""" Create ifcfg-* file with proper fields per device
"""
- cfg = self.CONFFILE_HEADER + '\n'
- cfg += """DEVICE=%s\nONBOOT=yes\n""" %
pipes.quote(name)
+ cfg = """DEVICE=%s\nONBOOT=yes\n""" %
pipes.quote(name)
cfg += conf
if ipconfig.ipaddr:
cfg = cfg + 'IPADDR=%s\n' % pipes.quote(ipconfig.ipaddr)
--
To view, visit
http://gerrit.ovirt.org/24103
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia49754b85797168df056ebd9acf81c151ad3980f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>