Skip to content

Commit

Permalink
Merge pull request ansible#13678 from Etherdaemon/fix_datetime_objects
Browse files Browse the repository at this point in the history
fix for datetime exception in ecs_tasks
  • Loading branch information
bcoca committed Feb 9, 2016
2 parents a54f472 + 0b92aba commit f50b381
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ansible/module_utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import pwd
import platform
import errno
import datetime
from itertools import repeat, chain

try:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f50b381

Please sign in to comment.