You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by se...@apache.org on 2015/05/05 15:26:23 UTC
[30/50] cloudstack-ec2stack git commit: Revert volumes.py
Revert volumes.py
Project: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/commit/ad3b688d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/tree/ad3b688d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/diff/ad3b688d
Branch: refs/heads/master
Commit: ad3b688d03eb7ac1314c129a06320a218e6d0a9b
Parents: 36ba44f
Author: BroganD1993 <da...@hotmail.com>
Authored: Sat Aug 16 10:26:41 2014 +0100
Committer: BroganD1993 <da...@hotmail.com>
Committed: Sat Aug 16 10:26:41 2014 +0100
----------------------------------------------------------------------
ec2stack/providers/cloudstack/volumes.py | 29 ++++++++-------------------
1 file changed, 8 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/ad3b688d/ec2stack/providers/cloudstack/volumes.py
----------------------------------------------------------------------
diff --git a/ec2stack/providers/cloudstack/volumes.py b/ec2stack/providers/cloudstack/volumes.py
index c89ed26..8b0cb4e 100644
--- a/ec2stack/providers/cloudstack/volumes.py
+++ b/ec2stack/providers/cloudstack/volumes.py
@@ -92,39 +92,26 @@ def _create_volume_request():
"""
args = {}
- zone_name = helpers.get('AvailabilityZone')
- zone_id = zones.get_zone(zone_name)['id']
-
- args['zoneid'] = zone_id
-
if helpers.contains_parameter('SnapshotId'):
args['snapshotid'] = helpers.get('SnapshotId')
- args['name'] = uuid.uuid1()
- args['command'] = 'createVolume'
- response = requester.make_request_async(args)
else:
helpers.require_parameters(['Size'])
- size = helpers.get('Size')
- disk_id = disk_offerings.get_disk_offering(
+ args['size'] = helpers.get('Size')
+ args['diskofferingid'] = disk_offerings.get_disk_offering(
current_app.config['CLOUDSTACK_CUSTOM_DISK_OFFERING']
)['id']
- response = create_cloudstack_volume_from_disk(disk_id, size, args)
-
- return response
-def create_cloudstack_volume_from_disk(disk_id, size, args):
- """
- Create a volume from disk offering.
+ zone_name = helpers.get('AvailabilityZone')
+ zone_id = zones.get_zone(zone_name)['id']
- @return: Response.
- """
+ args['zoneid'] = zone_id
args['command'] = 'createVolume'
- args['diskofferingid'] = disk_id
args['name'] = uuid.uuid1()
- args['size'] = size
- return requester.make_request_async(args)
+ response = requester.make_request_async(args)
+
+ return response
def _create_volume_response(response):