From a3b4488028804222b5acef3275137b89c125cb40 Mon Sep 17 00:00:00 2001 From: Alexander Bulimov Date: Mon, 11 Mar 2013 12:20:01 +0400 Subject: [PATCH] lvol patch for Debian Squeeze --- library/lvol | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/library/lvol b/library/lvol index afa1decff7..36cf4763bb 100644 --- a/library/lvol +++ b/library/lvol @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Jeroen Hoekx +# (c) 2013, Jeroen Hoekx , Alexander Bulimov # # This file is part of Ansible # @@ -64,7 +64,6 @@ def parse_lvs(data): lvs.append({ 'name': parts[0], 'size': int(parts[1].split('.')[0]), - 'path': parts[2], }) return lvs @@ -90,7 +89,7 @@ def main(): if size: size = int(size) - rc,current_lvs,err = module.run_command("lvs --noheadings -o lv_name,size,lv_path --units m --separator ';' %s"%(vg)) + rc,current_lvs,err = module.run_command("lvs --noheadings -o lv_name,size --units m --separator ';' %s"%(vg)) if rc != 0: module.fail_json(msg="Volume group %s does not exist."%vg, rc=rc, err=err) @@ -122,7 +121,7 @@ def main(): ### remove LV if module.check_mode: module.exit_json(changed=True) - rc,_,err = module.run_command("lvremove --force %s"%(this_lv['path'])) + rc,_,err = module.run_command("lvremove --force %s/%s"%(vg,this_lv['name'])) if rc == 0: module.exit_json(changed=True) else: @@ -138,7 +137,7 @@ def main(): if module.check_mode: changed = True else: - rc,_,err = module.run_command("%s -L %sm %s"%(tool, size, this_lv['path'])) + rc,_,err = module.run_command("%s -L %sm %s/%s"%(tool, size, vg, this_lv['name'])) if rc == 0: changed = True else: