diff --git a/swift/proxy/controllers/container.py b/swift/proxy/controllers/container.py index bb84739af1..305c904ad3 100644 --- a/swift/proxy/controllers/container.py +++ b/swift/proxy/controllers/container.py @@ -26,7 +26,7 @@ from swift.proxy.controllers.base import Controller, delay_denial, \ cors_validation, set_info_cache, clear_info_cache from swift.common.storage_policy import POLICIES from swift.common.swob import HTTPBadRequest, HTTPForbidden, \ - HTTPNotFound, HTTPServerError + HTTPNotFound, HTTPServiceUnavailable class ContainerController(Controller): @@ -275,7 +275,7 @@ class ContainerController(Controller): self.account_info(self.account_name, req) if not accounts and self.app.account_autocreate: if not self.autocreate_account(req, self.account_name): - return HTTPServerError(request=req) + return HTTPServiceUnavailable(request=req) account_partition, accounts, container_count = \ self.account_info(self.account_name, req) if not accounts: diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index bcc5a5bed1..bd7dae5e29 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -8006,7 +8006,7 @@ class TestContainerController(unittest.TestCase): # fail to retrieve account info test_status_map( (503, 503, 503), # account_info fails on 503 - 500, missing_container=True) + 503, missing_container=True) # account fail after creation test_status_map( (404, 404, 404, # account_info fails on 404 @@ -8017,7 +8017,7 @@ class TestContainerController(unittest.TestCase): (503, 503, 404, # account_info fails on 404 503, 503, 503, # PUT account 503, 503, 404), # account_info fail - 500, missing_container=True) + 503, missing_container=True) # put fails test_status_map( (404, 404, 404, # account_info fails on 404