diff options
author | Jasper Lievisse Adriaanse <jasper@humppa.nl> | 2017-01-18 21:15:38 +0100 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-01-18 12:23:36 -0800 |
commit | cc5080bc8a996658cdbadd80481d8652c0bd8261 (patch) | |
tree | 1e0e36f16219ef4e72a98b97c01e491a825b3265 | |
parent | af1c2aa9b37f2e01ecc69b921cee05bb84e5c9f5 (diff) | |
download | ansible-cc5080bc8a996658cdbadd80481d8652c0bd8261.tar.gz |
Fix argument name to fail_json(), detail -> details
Also use to_native(e) instead of str(e) while here as str() itself
might throw an exception when handling non-ASCII chars as pointed
out by @abadger
-rw-r--r-- | lib/ansible/modules/web_infrastructure/jenkins_plugin.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ansible/modules/web_infrastructure/jenkins_plugin.py b/lib/ansible/modules/web_infrastructure/jenkins_plugin.py index da985e560d..b90aebe2a9 100644 --- a/lib/ansible/modules/web_infrastructure/jenkins_plugin.py +++ b/lib/ansible/modules/web_infrastructure/jenkins_plugin.py @@ -21,8 +21,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception -from ansible.module_utils.urls import fetch_url -from ansible.module_utils.urls import url_argument_spec +from ansible.module_utils.urls import fetch_url, url_argument_spec +from ansible.module_utils._text import to_native import base64 import hashlib import json @@ -586,7 +586,7 @@ class JenkinsPlugin(object): e = get_exception() self.module.fail_json( msg="Cannot close the tmp updates file %s." % updates_file, - detail=str(e)) + details=to_native(e)) # Open the updates file try: @@ -595,7 +595,7 @@ class JenkinsPlugin(object): e = get_exception() self.module.fail_json( msg="Cannot open temporal updates file.", - details=str(e)) + details=to_native(e)) i = 0 for line in f: @@ -658,7 +658,7 @@ class JenkinsPlugin(object): e = get_exception() self.module.fail_json( msg='Cannot close the temporal plugin file %s.' % tmp_f, - details=str(e)) + details=to_native(e)) # Move the file onto the right place self.module.atomic_move(tmp_f, f) @@ -785,7 +785,7 @@ def main(): e = get_exception() module.fail_json( msg='Cannot convert %s to float.' % module.params['timeout'], - details=str(e)) + details=to_native(e)) # Set version to latest if state is latest if module.params['state'] == 'latest': |