pear: More info if failure occurs (#49735)

* added cli errors to error msg for pear
pull/49774/head
Brian Coca 6 years ago committed by GitHub
parent 260512459d
commit 8ce4720f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- more complete information when pear module has an error message

@ -66,6 +66,7 @@ EXAMPLES = '''
import os
from ansible.module_utils._text import to_text
from ansible.module_utils.basic import AnsibleModule
@ -140,7 +141,7 @@ def remove_packages(module, packages):
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
if rc != 0:
module.fail_json(msg="failed to remove %s" % (package))
module.fail_json(msg="failed to remove %s: %s" % (package, to_text(stdout + stderr)))
remove_c += 1
@ -171,7 +172,7 @@ def install_packages(module, state, packages):
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
if rc != 0:
module.fail_json(msg="failed to install %s" % (package))
module.fail_json(msg="failed to install %s: %s" % (package, to_text(stdout + stderr)))
install_c += 1

Loading…
Cancel
Save