Commit 45e71512 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Merge branch 'feature-cluster' into develop

parents 25ebcd06 7de6773d
This diff is collapsed.
......@@ -10,4 +10,5 @@ Developers Guide
developers/logging
developers/adding-commands
developers/extending-clients-api
developers/showcase
developers/code
......@@ -313,7 +313,7 @@ class PersonalityArgument(KeyValueArgument):
@property
def value(self):
return self._value if hasattr(self, '_value') else []
return getattr(self, '_value', [])
@value.setter
def value(self, newvalue):
......@@ -386,7 +386,7 @@ class server_create(_init_cyclades, _optional_json, _server_wait):
@errors.cyclades.cluster_size
def _create_cluster(self, prefix, flavor_id, image_id, size):
servers = [dict(
name='%s%s' % (prefix, i),
name='%s%s' % (prefix, i if size > 1 else ''),
flavor_id=flavor_id,
image_id=image_id,
personality=self['personality']) for i in range(1, 1 + size)]
......
......@@ -552,11 +552,16 @@ class file_create(_file_container_command, _optional_output_cmd):
@errors.pithos.connection
@errors.pithos.container
def _run(self, container):
self._optional_output(self.client.create_container(
container=container,
sizelimit=self['limit'],
versioning=self['versioning'],
metadata=self['meta']))
try:
self._optional_output(self.client.create_container(
container=container,
sizelimit=self['limit'],
versioning=self['versioning'],
metadata=self['meta'],
success=(201, )))
except ClientError as ce:
if ce.status in (202, ):
raiseCLIError(ce, 'Container %s alread exists' % container)
def main(self, container=None):
super(self.__class__, self)._run(container)
......
......@@ -34,7 +34,7 @@
from time import sleep
from kamaki.clients.cyclades.rest_api import CycladesRestClient
from kamaki.clients import ClientError, SilentEvent, sendlog
from kamaki.clients import ClientError
class CycladesClient(CycladesRestClient):
......
......@@ -105,7 +105,8 @@ class PithosClient(PithosRestClient):
def create_container(
self,
container=None, sizelimit=None, versioning=None, metadata=None):
container=None, sizelimit=None, versioning=None, metadata=None,
**kwargs):
"""
:param container: (str) if not given, self.container is used instead
......@@ -122,7 +123,8 @@ class PithosClient(PithosRestClient):
try:
self.container = container or cnt_back_up
r = self.container_put(
quota=sizelimit, versioning=versioning, metadata=metadata)
quota=sizelimit, versioning=versioning, metadata=metadata,
**kwargs)
return r.headers
finally:
self.container = cnt_back_up
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment