Skip to content

Instantly share code, notes, and snippets.

@clayg
Created March 18, 2014 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayg/9616127 to your computer and use it in GitHub Desktop.
Save clayg/9616127 to your computer and use it in GitHub Desktop.
diff --git a/swift/container/server.py b/swift/container/server.py
index eb72513..8069d20 100644
--- a/swift/container/server.py
+++ b/swift/container/server.py
@@ -229,9 +229,13 @@ class ContainerController(object):
broker = self._get_container_broker(drive, part, account, container)
if account.startswith(self.auto_create_account_prefix) and obj and \
not os.path.exists(broker.db_file):
+ requested_policy_index = (self.get_and_validate_policy_index(req)
+ or self.policies.default.idx)
try:
- broker.initialize(normalize_timestamp(
- req.headers.get('x-timestamp') or time.time()), -1)
+ broker.initialize(
+ normalize_timestamp(
+ req.headers.get('x-timestamp') or time.time()),
+ requested_policy_index)
except DatabaseAlreadyExists:
pass
if not os.path.exists(broker.db_file):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment