From 85bd54dfa7dfc710d5a4eafecd077338e47382ab Mon Sep 17 00:00:00 2001 From: Tuan-Anh Hoang-Vu Date: Wed, 28 Feb 2018 02:22:48 +0000 Subject: [PATCH] Fixed lvol ValueError with float size. --- lib/ansible/modules/system/lvol.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/system/lvol.py b/lib/ansible/modules/system/lvol.py index d123e0fe6ca..9be8e69ac33 100644 --- a/lib/ansible/modules/system/lvol.py +++ b/lib/ansible/modules/system/lvol.py @@ -507,10 +507,10 @@ def main(): else: # resize LV based on absolute values tool = None - if int(size) > this_lv['size']: + if float(size) > this_lv['size']: tool = module.get_bin_path("lvextend", required=True) - elif shrink and int(size) < this_lv['size']: - if int(size) == 0: + elif shrink and float(size) < this_lv['size']: + if float(size) == 0: module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) if not force: module.fail_json(msg="Sorry, no shrinking of %s without force=yes." % (this_lv['name']))