diff options
author | Brian Coca <bcoca@ansible.com> | 2016-02-09 17:07:28 -0500 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2016-02-09 17:07:28 -0500 |
commit | f50b381dbab229384f571180524c8fe509368925 (patch) | |
tree | 2fda7e648cc25cef8a4dd553344174f14abc746d | |
parent | a54f472b083ac50087dde31140455a10b7332d09 (diff) | |
parent | 0b92abaf67de53349bb4d2733f49750d9a4d8277 (diff) | |
download | ansible-f50b381dbab229384f571180524c8fe509368925.tar.gz |
Merge pull request #13678 from Etherdaemon/fix_datetime_objects
fix for datetime exception in ecs_tasks
-rw-r--r-- | lib/ansible/module_utils/basic.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index fbf4d0d340..4bb376c288 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -65,6 +65,7 @@ import grp import pwd import platform import errno +import datetime from itertools import repeat, chain try: @@ -423,10 +424,13 @@ def remove_values(value, no_log_strings): for omit_me in no_log_strings: if omit_me in stringy_value: return 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER' + elif isinstance(value, datetime.datetime): + value = value.isoformat() else: raise TypeError('Value of unknown type: %s, %s' % (type(value), value)) return value + def heuristic_log_sanitize(data, no_log_values=None): ''' Remove strings that look like passwords from log messages ''' # Currently filters: |