diff --git a/zaqar/storage/mongodb/utils.py b/zaqar/storage/mongodb/utils.py index 2be8a323a..600dde443 100644 --- a/zaqar/storage/mongodb/utils.py +++ b/zaqar/storage/mongodb/utils.py @@ -133,11 +133,12 @@ def stat_message(message, now): msg_id = message['id'] created = oid_ts(to_oid(msg_id)) age = now - created - + created_iso = datetime.datetime.utcfromtimestamp(created).strftime( + '%Y-%m-%dT%H:%M:%SZ') return { 'id': msg_id, 'age': int(age), - 'created': timeutils.iso8601_from_timestamp(created), + 'created': created_iso, } diff --git a/zaqar/storage/redis/models.py b/zaqar/storage/redis/models.py index 71400826a..1ec505d19 100644 --- a/zaqar/storage/redis/models.py +++ b/zaqar/storage/redis/models.py @@ -14,12 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +import datetime import functools import uuid import msgpack from oslo_utils import encodeutils -from oslo_utils import timeutils from oslo_utils import uuidutils MSGENV_FIELD_KEYS = (b'id', b't', b'cr', b'e', b'u', b'c', b'c.e', b'c.c') @@ -232,7 +232,8 @@ class Message(MessageEnvelope): } if include_created: - created_iso = timeutils.iso8601_from_timestamp(self.created) + created_iso = datetime.datetime.utcfromtimestamp( + self.created).strftime('%Y-%m-%dT%H:%M:%SZ') basic_msg['created'] = created_iso return basic_msg diff --git a/zaqar/storage/swift/messages.py b/zaqar/storage/swift/messages.py index f6aba9004..0151c1f18 100644 --- a/zaqar/storage/swift/messages.py +++ b/zaqar/storage/swift/messages.py @@ -12,6 +12,7 @@ # limitations under the License. import copy +import datetime import functools import uuid @@ -341,10 +342,12 @@ class MessageQueueHandler(object): raise else: created = float(headers['x-timestamp']) + created_iso = datetime.datetime.utcfromtimestamp( + created).strftime('%Y-%m-%dT%H:%M:%SZ') newest = { 'id': obj['name'], 'age': now - created, - 'created': timeutils.iso8601_from_timestamp(created)} + 'created': created_iso} if oldest is None: oldest = copy.deepcopy(newest) total += 1