Created
February 22, 2012 11:42
-
-
Save vinilios/1884440 to your computer and use it in GitHub Desktop.
pithos-sh create fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git snf-pithos-tools/pithos/tools/sh.py snf-pithos-tools/pithos/tools/sh.py | |
index f0ae12c..8dac56a 100755 | |
--- snf-pithos-tools/pithos/tools/sh.py | |
+++ snf-pithos-tools/pithos/tools/sh.py | |
@@ -225,12 +225,12 @@ class Meta(Command): | |
class CreateContainer(Command): | |
syntax = '<container> [key=val] [...]' | |
description = 'create a container' | |
- policy={} | |
+ policy={'versioning':'', 'quota':''} | |
def add_options(self, parser): | |
- parser.add_option('--versioning', action='store', dest=policy['versioning'], | |
+ parser.add_option('--versioning', action='store', dest=self.policy['versioning'], | |
default=None, help='set container versioning (auto/none)') | |
- parser.add_option('--quota', action='store', dest=policy['quota'], | |
+ parser.add_option('--quota', action='store', dest=self.policy['quota'], | |
default=None, help='set default container quota') | |
def execute(self, container, *args): | |
@@ -238,7 +238,7 @@ class CreateContainer(Command): | |
for arg in args: | |
key, sep, val = arg.partition('=') | |
meta[key] = val | |
- ret = self.client.create_container(container, meta=meta, policies=policy) | |
+ ret = self.client.create_container(container, meta=meta, policies=self.policy) | |
if not ret: | |
print 'Container already exists' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment