mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
lvol: check return message in both stderr and stdout (#7601)
* lvol: check return message in both stderr and stdout * add changelog frag
This commit is contained in:
parent
07bac1777f
commit
32558558c0
2 changed files with 6 additions and 4 deletions
|
@ -552,9 +552,9 @@ def main():
|
|||
elif rc == 0:
|
||||
changed = True
|
||||
msg = "Volume %s resized to %s%s" % (this_lv['name'], size_requested, unit)
|
||||
elif "matches existing size" in err:
|
||||
elif "matches existing size" in err or "matches existing size" in out:
|
||||
module.exit_json(changed=False, vg=vg, lv=this_lv['name'], size=this_lv['size'])
|
||||
elif "not larger than existing size" in err:
|
||||
elif "not larger than existing size" in err or "not larger than existing size" in out:
|
||||
module.exit_json(changed=False, vg=vg, lv=this_lv['name'], size=this_lv['size'], msg="Original size is larger than requested size", err=err)
|
||||
else:
|
||||
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err)
|
||||
|
@ -585,9 +585,9 @@ def main():
|
|||
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err, out=out)
|
||||
elif rc == 0:
|
||||
changed = True
|
||||
elif "matches existing size" in err:
|
||||
elif "matches existing size" in err or "matches existing size" in out:
|
||||
module.exit_json(changed=False, vg=vg, lv=this_lv['name'], size=this_lv['size'])
|
||||
elif "not larger than existing size" in err:
|
||||
elif "not larger than existing size" in err or "not larger than existing size" in out:
|
||||
module.exit_json(changed=False, vg=vg, lv=this_lv['name'], size=this_lv['size'], msg="Original size is larger than requested size", err=err)
|
||||
else:
|
||||
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue