mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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
2
changelogs/fragments/7601-lvol-fix.yml
Normal file
2
changelogs/fragments/7601-lvol-fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- lvol - test for output messages in both ``stdout`` and ``stderr`` (https://github.com/ansible-collections/community.general/pull/7601, https://github.com/ansible-collections/community.general/issues/7182).
|
|
@ -552,9 +552,9 @@ def main():
|
||||||
elif rc == 0:
|
elif rc == 0:
|
||||||
changed = True
|
changed = True
|
||||||
msg = "Volume %s resized to %s%s" % (this_lv['name'], size_requested, unit)
|
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'])
|
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)
|
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:
|
else:
|
||||||
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err)
|
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)
|
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err, out=out)
|
||||||
elif rc == 0:
|
elif rc == 0:
|
||||||
changed = True
|
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'])
|
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)
|
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:
|
else:
|
||||||
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err)
|
module.fail_json(msg="Unable to resize %s to %s%s" % (lv, size, size_unit), rc=rc, err=err)
|
||||||
|
|
Loading…
Reference in a new issue