Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD35B17F26 for ; Tue, 5 May 2015 13:26:00 +0000 (UTC) Received: (qmail 7337 invoked by uid 500); 5 May 2015 13:25:56 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 7284 invoked by uid 500); 5 May 2015 13:25:56 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 7179 invoked by uid 99); 5 May 2015 13:25:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 13:25:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E109BE10A2; Tue, 5 May 2015 13:25:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sebgoa@apache.org To: commits@cloudstack.apache.org Date: Tue, 05 May 2015 13:26:13 -0000 Message-Id: <2f235cc175c84380a0d4bf4bcd2751c9@git.apache.org> In-Reply-To: <221c3e069cfc492fb79c05f2b8305f09@git.apache.org> References: <221c3e069cfc492fb79c05f2b8305f09@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [20/50] cloudstack-ec2stack git commit: Fix bug where VPC_OFFERING_ID isn't in configuration and user tries to create vpc 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 Authored: Thu Aug 7 18:38:33 2014 +0100 Committer: BroganD1993 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)