From 8ae7be3e524fa52ad8f56e998a32559d73144a3b Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 7 Jul 2009 18:21:25 -1000 Subject: Include lv_attr in lvm.lvs() return value. Include the lv_attr field in the lvm.lvs() hash table returned. Needed to tell if the logical volume is active or not. --- storage/devicelibs/lvm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'storage') diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py index a5eb59d8a..671113a92 100644 --- a/storage/devicelibs/lvm.py +++ b/storage/devicelibs/lvm.py @@ -319,7 +319,7 @@ def vginfo(vg_name): def lvs(vg_name): args = ["lvs", "--noheadings", "--nosuffix"] + \ ["--units", "m"] + \ - ["-o", "lv_name,lv_uuid,lv_size"] + \ + ["-o", "lv_name,lv_uuid,lv_size,lv_attr"] + \ config_args + \ [vg_name] @@ -332,9 +332,10 @@ def lvs(vg_name): line = line.strip() if not line: continue - (name, uuid, size) = line.split() + (name, uuid, size, attr) = line.split() lvs[name] = {"size": size, - "uuid": uuid} + "uuid": uuid, + "attr": attr} if not lvs: raise LVMError(_("lvs failed for %s" % vg_name)) -- cgit