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 001EB10A57 for ; Tue, 30 Jul 2013 21:31:28 +0000 (UTC) Received: (qmail 28106 invoked by uid 500); 30 Jul 2013 21:31:28 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 28080 invoked by uid 500); 30 Jul 2013 21:31:28 -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 28073 invoked by uid 99); 30 Jul 2013 21:31:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jul 2013 21:31:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A29B1830651; Tue, 30 Jul 2013 21:31:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alena1108@apache.org To: commits@cloudstack.apache.org Message-Id: <08a1637badd644d2af66486f255c0f06@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.2 to 026cca4 Date: Tue, 30 Jul 2013 21:31:28 +0000 (UTC) Updated Branches: refs/heads/4.2 452722736 -> 026cca46c CLOUDSTACK-3948: fixed createAutoscaleVmProfile - for situation when no autoscaleUserId is passed in, take it from caller user id, not caller account id Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/026cca46 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/026cca46 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/026cca46 Branch: refs/heads/4.2 Commit: 026cca46c65ee50505dd7f839542315eac55373c Parents: 4527227 Author: Alena Prokharchyk Authored: Tue Jul 30 14:11:29 2013 -0700 Committer: Alena Prokharchyk Committed: Tue Jul 30 14:31:22 2013 -0700 ---------------------------------------------------------------------- .../command/user/autoscale/CreateAutoScaleVmProfileCmd.java | 4 ++-- server/src/com/cloud/network/as/AutoScaleManagerImpl.java | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/026cca46/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java index 87d4466..05c9851 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java @@ -115,11 +115,11 @@ public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd { return otherDeployParams; } - public Long getAutoscaleUserId() { + public long getAutoscaleUserId() { if (autoscaleUserId != null) { return autoscaleUserId; } else { - return UserContext.current().getCaller().getId(); + return UserContext.current().getCallerUserId(); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/026cca46/server/src/com/cloud/network/as/AutoScaleManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index 247441e..96f6ada 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -311,7 +311,7 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScale long zoneId = cmd.getZoneId(); long serviceOfferingId = cmd.getServiceOfferingId(); - Long autoscaleUserId = cmd.getAutoscaleUserId(); + long autoscaleUserId = cmd.getAutoscaleUserId(); DataCenter zone = _configMgr.getZone(zoneId); @@ -336,10 +336,6 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScale */ ApiDispatcher.processParameters(new DeployVMCmd(), deployParams); - if (autoscaleUserId == null) { - autoscaleUserId = UserContext.current().getCallerUserId(); - } - AutoScaleVmProfileVO profileVO = new AutoScaleVmProfileVO(cmd.getZoneId(), cmd.getDomainId(), cmd.getAccountId(), cmd.getServiceOfferingId(), cmd.getTemplateId(), cmd.getOtherDeployParams(), cmd.getCounterParamList(), cmd.getDestroyVmGraceperiod(), autoscaleUserId); profileVO = checkValidityAndPersist(profileVO);