summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjerry <j.garcia@kainos.com>2016-11-21 20:28:51 +0000
committerBrian Coca <bcoca@users.noreply.github.com>2017-02-08 15:53:19 -0500
commitc4b09cbcb4df160509f44ffddfedf586391b6878 (patch)
treed30c6c60ad575d9ad294f35aa927f8bac45fdb8b
parentef1ecfd2c28412531fc7e0482b66dab92226306f (diff)
downloadansible-c4b09cbcb4df160509f44ffddfedf586391b6878.tar.gz
removing unwanted variables and using to_native instead of str()
-rw-r--r--lib/ansible/module_utils/basic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py
index 1b1389d8ee..fa20373a6a 100644
--- a/lib/ansible/module_utils/basic.py
+++ b/lib/ansible/module_utils/basic.py
@@ -2268,11 +2268,11 @@ class AnsibleModule(object):
rc = cmd.returncode
except (OSError, IOError):
e = get_exception()
- self.log("%s: Error Executing CMD:%s PERM:%s Exception:%s" % (args[0] , args[1] , str(e)))
+ self.log("Error Executing CMD:%s Exception:%s" % (clean_args, to_native(e)))
self.fail_json(rc=e.errno, msg=to_native(e), cmd=clean_args)
except Exception:
e = get_exception()
- self.log("%s: Error Executing CMD:%s PERM:%s Exception:%s" % (args[0] , args[1] , str(traceback.format_exc())))
+ self.log("Error Executing CMD:%s Exception:%s" % (clean_args,to_native(traceback.format_exc())))
self.fail_json(rc=257, msg=to_native(e), exception=traceback.format_exc(), cmd=clean_args)
# Restore env settings