Merge "Logging a policy index when container PUT request conflicts"
This commit is contained in:
commit
923e17b2b8
@ -308,7 +308,9 @@ class ContainerController(BaseStorageServer):
|
||||
elif requested_policy_index is not None:
|
||||
# validate requested policy with existing container
|
||||
if requested_policy_index != broker.storage_policy_index:
|
||||
raise HTTPConflict(request=req)
|
||||
raise HTTPConflict(request=req,
|
||||
headers={'x-backend-storage-policy-index':
|
||||
broker.storage_policy_index})
|
||||
broker.update_put_timestamp(timestamp)
|
||||
if broker.is_deleted():
|
||||
raise HTTPConflict(request=req)
|
||||
|
@ -476,6 +476,9 @@ class TestContainerController(unittest.TestCase):
|
||||
})
|
||||
resp = req.get_response(self.controller)
|
||||
self.assertEquals(resp.status_int, 409)
|
||||
self.assertEquals(
|
||||
resp.headers.get('X-Backend-Storage-Policy-Index'),
|
||||
str(policy.idx))
|
||||
|
||||
# and make sure there is no change!
|
||||
req = Request.blank('/sda1/p/a/c')
|
||||
|
Loading…
x
Reference in New Issue
Block a user