Skip to content

Instantly share code, notes, and snippets.

@vinilios
Created February 22, 2012 11:42
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 vinilios/1884440 to your computer and use it in GitHub Desktop.
Save vinilios/1884440 to your computer and use it in GitHub Desktop.
pithos-sh create fix
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