Merge pull request #3590 from fgtham/lvol_fix

Fix for  Issue #3586:  UnboundedLocalError when removing a logical volume.
This commit is contained in:
Michael DeHaan 2013-07-19 06:02:15 -07:00
commit 6b2be84a27

View file

@ -96,6 +96,8 @@ def main():
lv = module.params['lv'] lv = module.params['lv']
size = module.params['size'] size = module.params['size']
state = module.params['state'] state = module.params['state']
size_opt = 'L'
size_unit = 'm'
if state=='present' and not size: if state=='present' and not size:
module.fail_json(msg="No size given.") module.fail_json(msg="No size given.")
@ -128,9 +130,7 @@ def main():
module.fail_json(msg="Size unit should be one of [bBsSkKmMgGtTpPeE]") module.fail_json(msg="Size unit should be one of [bBsSkKmMgGtTpPeE]")
# when no unit, megabytes by default # when no unit, megabytes by default
elif size.isdigit(): elif size.isdigit():
size_unit = 'm'
size = int(size) size = int(size)
size_opt = 'L'
else: else:
module.fail_json(msg="Bad size specification") module.fail_json(msg="Bad size specification")