cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [20/50] cloudstack-ec2stack git commit: Fix bug where VPC_OFFERING_ID isn't in configuration and user tries to create vpc
Date Tue, 05 May 2015 13:26:13 GMT
Fix bug where VPC_OFFERING_ID isn't in configuration and user tries to create vpc


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/commit/064531a3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/tree/064531a3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/diff/064531a3

Branch: refs/heads/master
Commit: 064531a3e4b8cb6f6f6d3293d5abe99afbdfce20
Parents: 7c5417e
Author: BroganD1993 <darrenbrogan@hotmail.com>
Authored: Thu Aug 7 18:38:33 2014 +0100
Committer: BroganD1993 <darrenbrogan@hotmail.com>
Committed: Thu Aug 7 18:38:33 2014 +0100

----------------------------------------------------------------------
 ec2stack/providers/cloudstack/vpcs.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/064531a3/ec2stack/providers/cloudstack/vpcs.py
----------------------------------------------------------------------
diff --git a/ec2stack/providers/cloudstack/vpcs.py b/ec2stack/providers/cloudstack/vpcs.py
index 55c81d8..9591d54 100644
--- a/ec2stack/providers/cloudstack/vpcs.py
+++ b/ec2stack/providers/cloudstack/vpcs.py
@@ -37,7 +37,14 @@ def _create_vpc_request():
     args['displaytext'] = name
     args['zoneid'] = zones.get_zone(
         current_app.config['CLOUDSTACK_DEFAULT_ZONE'])['id']
-    args['vpcofferingid'] = current_app.config['VPC_OFFERING_ID']
+
+    if 'VPC_OFFERING_ID' in current_app.config:
+        args['vpcofferingid'] = current_app.config['VPC_OFFERING_ID']
+    else:
+        errors.invalid_request(
+            str('VPC_OFFERING_ID') + " not found in configuration, " +
+            "please run ec2stack-configure -a True")
+
     args['cidr'] = helpers.get('CidrBlock')
 
     response = requester.make_request_async(args)


Mime
View raw message