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), utils._message_container(queue, project),
msg['id'], msg['id'],
content, content,
content_type='application/json',
headers={'x-object-meta-clientid': msg['client_uuid'], headers={'x-object-meta-clientid': msg['client_uuid'],
'if-match': md5, 'if-match': md5,
'x-object-meta-claimid': claim_id, 'x-object-meta-claimid': claim_id,
@ -137,6 +138,7 @@ class ClaimController(storage.Claim):
utils._claim_container(queue, project), utils._claim_container(queue, project),
claim_id, claim_id,
jsonutils.dumps([msg['id'] for msg in claimed]), jsonutils.dumps([msg['id'] for msg in claimed]),
content_type='application/json',
headers={'x-delete-after': ttl} headers={'x-delete-after': ttl}
) )
@ -152,6 +154,7 @@ class ClaimController(storage.Claim):
raise raise
self._client.put_object(container, claim_id, obj, self._client.put_object(container, claim_id, obj,
content_type='application/json',
headers={'x-delete-after': metadata['ttl']}) headers={'x-delete-after': metadata['ttl']})
def delete(self, queue, claim_id, project=None): def delete(self, queue, claim_id, project=None):
@ -176,6 +179,7 @@ class ClaimController(storage.Claim):
utils._message_container(queue, project), utils._message_container(queue, project),
msg_id, msg_id,
content, content,
content_type='application/json',
headers={'x-object-meta-clientid': client_id, headers={'x-object-meta-clientid': client_id,
'if-match': md5, 'if-match': md5,
'x-delete-at': headers['x-delete-at']}) 'x-delete-at': headers['x-delete-at']})

View File

@ -220,6 +220,7 @@ class MessageController(storage.Message):
utils._message_container(queue, project), utils._message_container(queue, project),
slug, slug,
contents=contents, contents=contents,
content_type='application/json',
headers={ headers={
'x-object-meta-clientid': str(client_uuid), 'x-object-meta-clientid': str(client_uuid),
'x-delete-after': msg['ttl']}) 'x-delete-after': msg['ttl']})

View File

@ -98,7 +98,7 @@ class SubscriptionController(storage.Subscription):
'confirmed': False} 'confirmed': False}
utils._put_or_create_container( utils._put_or_create_container(
self._client, container, slug, contents=jsonutils.dumps(data), self._client, container, slug, contents=jsonutils.dumps(data),
headers={'x-delete-after': ttl}) content_type='application/json', headers={'x-delete-after': ttl})
return slug return slug
def update(self, queue, subscription_id, project=None, **kwargs): def update(self, queue, subscription_id, project=None, **kwargs):
@ -124,6 +124,7 @@ class SubscriptionController(storage.Subscription):
self._client.put_object(container, self._client.put_object(container,
subscription_id, subscription_id,
contents=jsonutils.dumps(data), contents=jsonutils.dumps(data),
content_type='application/json',
headers={'x-delete-after': ttl}) headers={'x-delete-after': ttl})
def exists(self, queue, subscription_id, project=None): def exists(self, queue, subscription_id, project=None):