Merge "Add missing content type in Swift objects"

This commit is contained in:
Jenkins 2017-03-17 07:20:30 +00:00 committed by Gerrit Code Review
commit 52f2fc313c
3 changed files with 7 additions and 1 deletions

View File

@ -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']})

View File

@ -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']})

View File

@ -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):