diff --git a/zaqar/storage/swift/claims.py b/zaqar/storage/swift/claims.py index ae7dc7605..b5e4ffbd6 100644 --- a/zaqar/storage/swift/claims.py +++ b/zaqar/storage/swift/claims.py @@ -119,6 +119,7 @@ class ClaimController(storage.Claim): utils._message_container(queue, project), msg['id'], content, + content_type='application/json', headers={'x-object-meta-clientid': msg['client_uuid'], 'if-match': md5, 'x-object-meta-claimid': claim_id, @@ -137,6 +138,7 @@ class ClaimController(storage.Claim): utils._claim_container(queue, project), claim_id, jsonutils.dumps([msg['id'] for msg in claimed]), + content_type='application/json', headers={'x-delete-after': ttl} ) @@ -152,6 +154,7 @@ class ClaimController(storage.Claim): raise self._client.put_object(container, claim_id, obj, + content_type='application/json', headers={'x-delete-after': metadata['ttl']}) def delete(self, queue, claim_id, project=None): @@ -176,6 +179,7 @@ class ClaimController(storage.Claim): utils._message_container(queue, project), msg_id, content, + content_type='application/json', headers={'x-object-meta-clientid': client_id, 'if-match': md5, 'x-delete-at': headers['x-delete-at']}) diff --git a/zaqar/storage/swift/messages.py b/zaqar/storage/swift/messages.py index 3c5c2c817..f1ddb4666 100644 --- a/zaqar/storage/swift/messages.py +++ b/zaqar/storage/swift/messages.py @@ -220,6 +220,7 @@ class MessageController(storage.Message): utils._message_container(queue, project), slug, contents=contents, + content_type='application/json', headers={ 'x-object-meta-clientid': str(client_uuid), 'x-delete-after': msg['ttl']}) diff --git a/zaqar/storage/swift/subscriptions.py b/zaqar/storage/swift/subscriptions.py index cbc73d238..0058fed3d 100644 --- a/zaqar/storage/swift/subscriptions.py +++ b/zaqar/storage/swift/subscriptions.py @@ -98,7 +98,7 @@ class SubscriptionController(storage.Subscription): 'confirmed': False} utils._put_or_create_container( self._client, container, slug, contents=jsonutils.dumps(data), - headers={'x-delete-after': ttl}) + content_type='application/json', headers={'x-delete-after': ttl}) return slug def update(self, queue, subscription_id, project=None, **kwargs): @@ -124,6 +124,7 @@ class SubscriptionController(storage.Subscription): self._client.put_object(container, subscription_id, contents=jsonutils.dumps(data), + content_type='application/json', headers={'x-delete-after': ttl}) def exists(self, queue, subscription_id, project=None):