Skip to content
Permalink
Browse files
Change how args are passed to create volume, clean up a little
  • Loading branch information
brogand93 committed Feb 22, 2014
1 parent e39e45f commit 78a79ee3a264b42fd09b017347d0a87b9ab4e6fa
Showing 1 changed file with 6 additions and 3 deletions.
@@ -35,14 +35,15 @@ def delete_volume():
def create_volume():
helpers.require_one_paramater(['SnapshotId', 'Size'])

args = {}
if helpers.contains_parameter('SnapshotId'):
args['snapshotid'] = helpers.get('SnapshotId', request.form)
else:
args['size'] = helpers.get('Size', request.form)
args['diskofferingid'] = \
disk_offerings.get_disk_offerings_id_by_name('Custom')

response = _create_volume_request()
response = _create_volume_request(args)
return create_volume_response(response)


@@ -70,8 +71,10 @@ def _describe_volumes_request():
return response


def _create_volume_request():
args = {}
def _create_volume_request(args = None):
if args is None:
args = {}

args['zoneid'] = helpers.get('AvailabilityZone', request.form)
args['command'] = 'createVolume'
args['name'] = uuid.uuid4()

0 comments on commit 78a79ee

Please sign in to comment.