Change in vdsm[master]: changes in configfile.py.
mtayer at redhat.com
mtayer at redhat.com
Sun Jun 8 13:16:47 UTC 2014
mooli tayer has uploaded a new change for review.
Change subject: changes in configfile.py.
......................................................................
changes in configfile.py.
1.) remove suffix space from '# VDSM backup '. This way we maintain backward comp
with libvirt_configure.sh
2.) on ovirt node wrap calls to rename with ovirt node unpersist and persist.
these calls use the new node namespace being ovirt.node.utils.fs.Config.
Change-Id: I76aced9da7a68eefdb60b82907bc83d224e449f5
Signed-off-by: Mooli Tayer <mtayer at redhat.com>
---
M lib/vdsm/tool/configfile.py
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/28463/1
diff --git a/lib/vdsm/tool/configfile.py b/lib/vdsm/tool/configfile.py
index afeab02..9b5a703 100644
--- a/lib/vdsm/tool/configfile.py
+++ b/lib/vdsm/tool/configfile.py
@@ -25,6 +25,9 @@
import selinux
import io
+from .. import utils
+if utils.isOvirtNode:
+ from ovirt.node.utils.fs import Config
(
BEFORE,
@@ -82,7 +85,7 @@
version,
sectionStart='## beginning of configuration section by vdsm',
sectionEnd='## end of configuration section by vdsm',
- prefix='# VDSM backup ',
+ prefix='# VDSM backup',
lineComment='by vdsm'):
if not os.path.exists(filename):
raise OSError(
@@ -170,7 +173,13 @@
f.writelines(oldlines)
if self._entries:
self._writeEntries(f, oldentries)
+
+ if utils.isOvirtNode():
+ Config().unpersist(self._filename)
os.rename(tname, self._filename)
+ if utils.isOvirtNode():
+ Config().persist(self._filename)
+
if self._oldmod != os.stat(self._filename).st_mode:
os.chmod(self._filename, self._oldmod)
--
To view, visit http://gerrit.ovirt.org/28463
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I76aced9da7a68eefdb60b82907bc83d224e449f5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>
More information about the vdsm-patches
mailing list