Alon Bar-Lev has uploaded a new change for review.
Change subject: utils: add ovirt-node persistence functions
......................................................................
utils: add ovirt-node persistence functions
Change-Id: Ib93af61a44a52c37faf92d6f6081babefa3a09aa
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/20811/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 78d055e..acb284c 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -877,3 +877,27 @@
logging.error("Panic: %s", msg, exc_info=True)
os.killpg(0, 9)
sys.exit(-3)
+
+
+@memoized
+def isOvirtNode():
+ return (
+ os.path.exists('/etc/rhev-hypervisor-release') or
+ glob.glob('/etc/ovirt-node-*-release')
+ )
+
+
+def ovirtNodePersist(files):
+ if isOvirtNode():
+ from ovirtnode import ovirtfunctions
+ ovirtfunctions.ovirt_store_config(files)
+
+
+def ovirtNodeUnpersist(files):
+ if isOvirtNode():
+ from ovirtnode import ovirtfunctions
+ todo = []
+ for f in files:
+ if ovirtfunctions.is_persisted(f):
+ todo.append(f)
+ ovirtfunctions.remove_config([todo])
--
To view, visit
http://gerrit.ovirt.org/20811
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib93af61a44a52c37faf92d6f6081babefa3a09aa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>