[PATCH 2/5] Add function lvorigin to determine the name of a snapshot's origin lv.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 storage/devicelibs/lvm.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py
index f3814a4..5fa9198 100644
--- a/storage/devicelibs/lvm.py
+++ b/storage/devicelibs/lvm.py
@@ -349,6 +349,22 @@ def lvs(vg_name):
 
     return lvs
 
+def lvorigin(vg_name, lv_name):
+    args = ["lvs", "--noheadings", "-o", "origin"] + \
+            config_args + \
+            ["%s/%s" % (vg_name, lv_name)]
+
+    buf = iutil.execWithCapture("lvm",
+                                args,
+                                stderr="/dev/tty5")
+
+    try:
+        origin = buf.splitlines()[0].strip()
+    except IndexError:
+        origin = ''
+
+    return origin
+
 def lvcreate(vg_name, lv_name, size):
     args = ["lvcreate"] + \
             ["-L", "%dm" % size] + \
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux