Switched to different datetime formatting in JSON.
We now use the same format as the Pillar API.
This commit is contained in:
@@ -22,6 +22,8 @@ else:
|
||||
string_type = basestring
|
||||
text_type = unicode
|
||||
|
||||
JSON_DATE_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'
|
||||
|
||||
|
||||
class PillarJSONEncoder(json.JSONEncoder):
|
||||
"""JSON encoder with support for Pillar resources."""
|
||||
@@ -31,7 +33,7 @@ class PillarJSONEncoder(json.JSONEncoder):
|
||||
from .resource import Resource
|
||||
|
||||
if isinstance(obj, datetime.datetime):
|
||||
return obj.isoformat(' ')
|
||||
return obj.strftime(JSON_DATE_FORMAT)
|
||||
if isinstance(obj, Resource):
|
||||
return obj.to_dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user