[PATCH 08/17] Add ignore_skip keyword arg to lvactivate.

David Lehman dlehman at redhat.com
Thu Jun 5 16:47:28 UTC 2014


Thin snapshots are marked to be skipped at activation time by default, so
this extra argument is required to activate them.
---
 blivet/devicelibs/lvm.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index f65ff9f..8ad6735 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -501,11 +501,13 @@ def lvresize(vg_name, lv_name, size):
     except LVMError as msg:
         raise LVMError("lvresize failed for %s: %s" % (lv_name, msg))
 
-def lvactivate(vg_name, lv_name):
+def lvactivate(vg_name, lv_name, ignore_skip=False):
     # see if lvchange accepts paths of the form 'mapper/$vg-$lv'
-    args = ["lvchange", "-a", "y"] + \
-            _getConfigArgs() + \
-            ["%s/%s" % (vg_name, lv_name)]
+    args = ["lvchange", "-a", "y"]
+    if ignore_skip:
+        args.append("-K")
+
+    args += _getConfigArgs() + ["%s/%s" % (vg_name, lv_name)]
 
     try:
         lvm(args)
-- 
1.9.0



More information about the anaconda-patches mailing list