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 E218F11A18 for ; Wed, 11 Jun 2014 00:50:59 +0000 (UTC) Received: (qmail 43871 invoked by uid 500); 11 Jun 2014 00:50:59 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 43837 invoked by uid 500); 11 Jun 2014 00:50:59 -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 43830 invoked by uid 99); 11 Jun 2014 00:50:59 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2014 00:50:59 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 09BBE926681; Wed, 11 Jun 2014 00:50:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: commits@cloudstack.apache.org Message-Id: <837950657be043ef97bcb309088ebec4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to e61dda7 Date: Wed, 11 Jun 2014 00:50:58 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master 9334f2608 -> e61dda7d8 CLOUDSTACK-6890:createVPC invoked by admin does not observe start flag. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e61dda7d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e61dda7d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e61dda7d Branch: refs/heads/master Commit: e61dda7d82f24107c878906162aea65a67aa832e Parents: 9334f26 Author: Min Chen Authored: Tue Jun 10 17:23:20 2014 -0700 Committer: Min Chen Committed: Tue Jun 10 17:35:15 2014 -0700 ---------------------------------------------------------------------- .../api/command/admin/vpc/CreateVPCCmdByAdmin.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e61dda7d/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java index f063cdb..25e6325 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java @@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.vpc; import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -37,10 +38,14 @@ public class CreateVPCCmdByAdmin extends CreateVPCCmd { @Override public void execute() { Vpc vpc = null; + boolean success = true; try { - if (_vpcService.startVpc(getEntityId(), true)) { - vpc = _entityMgr.findById(Vpc.class, getEntityId()); + if (isStart()) { + success = _vpcService.startVpc(getEntityId(), true); + } else { + s_logger.debug("Not starting VPC as " + ApiConstants.START + "=false was passed to the API"); } + vpc = _entityMgr.findById(Vpc.class, getEntityId()); } catch (ResourceUnavailableException ex) { s_logger.warn("Exception: ", ex); throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());