Change in vdsm[master]: utils: Use ovirt node for persist files
ykaplan at redhat.com
ykaplan at redhat.com
Mon Sep 29 09:48:48 UTC 2014
Yeela Kaplan has uploaded a new change for review.
Change subject: utils: Use ovirt node for persist files
......................................................................
utils: Use ovirt node for persist files
Change-Id: Ice245d54497862f9fb86cb32acd13b8a790026b2
Signed-off-by: Yeela Kaplan <ykaplan at redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/33468/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index e08ec3c..d619e98 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -53,6 +53,15 @@
from cpopen import CPopen
from . import constants
+try:
+ from ovirt.node.utils.fs import Config
+ cfg = Config()
+ persistFile = cfg.persist
+ del cfg
+except ImportError:
+ persistFile = lambda name: None
+
+
# Buffsize is 1K because I tested it on some use cases and 1K was fastest. If
# you find this number to be a bottleneck in any way you are welcome to change
# it
@@ -141,11 +150,6 @@
logging.warning("Directory: %s already removed", directoryToRemove)
else:
raise
-
-
-def persistFile(name):
- if isOvirtNode():
- execCmd([constants.EXT_PERSIST, name], sudo=True)
def _parseMemInfo(lines):
--
To view, visit http://gerrit.ovirt.org/33468
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice245d54497862f9fb86cb32acd13b8a790026b2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
More information about the vdsm-patches
mailing list