From 7be55e188a1fb29396ef599014798b2e35d459c2 Mon Sep 17 00:00:00 2001 From: Pavol Ipoth Date: Mon, 11 Apr 2016 21:55:40 +0200 Subject: [PATCH] Fixes #2008 Lvol module is not indempodent for cache lv's --- system/lvol.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/system/lvol.py b/system/lvol.py index d098843614c..5cd082e96b0 100644 --- a/system/lvol.py +++ b/system/lvol.py @@ -79,6 +79,9 @@ EXAMPLES = ''' # Create a logical volume of 512m with disks /dev/sda and /dev/sdb - lvol: vg=firefly lv=test size=512 pvs=/dev/sda,/dev/sdb +# Create cache pool logical volume +- lvol: vg=firefly lv=lvcache size=512m opts='--type cache-pool' + # Create a logical volume of 512g. - lvol: vg=firefly lv=test size=512g @@ -122,7 +125,7 @@ def parse_lvs(data): for line in data.splitlines(): parts = line.strip().split(';') lvs.append({ - 'name': parts[0], + 'name': parts[0].replace('[','').replace(']',''), 'size': int(decimal_point.match(parts[1]).group(1)) }) return lvs @@ -245,7 +248,7 @@ def main(): # Get information on logical volume requested lvs_cmd = module.get_bin_path("lvs", required=True) rc, current_lvs, err = module.run_command( - "%s --noheadings --nosuffix -o lv_name,size --units %s --separator ';' %s" % (lvs_cmd, unit, vg)) + "%s -a --noheadings --nosuffix -o lv_name,size --units %s --separator ';' %s" % (lvs_cmd, unit, vg)) if rc != 0: if state == 'absent':