From 9b7c4a6c476fbcafb1cbad81a699cea3f55ad4f2 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Tue, 30 Jul 2013 14:11:29 -0700 Subject: [PATCH] CLOUDSTACK-3948: fixed createAutoscaleVmProfile - for situation when no autoscaleUserId is passed in, take it from caller user id, not caller account id Conflicts: api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java server/src/com/cloud/network/as/AutoScaleManagerImpl.java --- .../command/user/autoscale/CreateAutoScaleVmProfileCmd.java | 4 ++-- server/src/com/cloud/network/as/AutoScaleManagerImpl.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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 3b5567d7532..192185ea94e 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 @@ -116,11 +116,11 @@ public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd { return otherDeployParams; } - public Long getAutoscaleUserId() { + public long getAutoscaleUserId() { if (autoscaleUserId != null) { return autoscaleUserId; } else { - return CallContext.current().getCallingAccount().getId(); + return CallContext.current().getCallingUserId(); } } diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index 213ff6715ed..8c8a805716b 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -313,7 +313,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); @@ -338,10 +338,13 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScale */ ApiDispatcher.processParameters(new DeployVMCmd(), deployParams); +<<<<<<< HEAD if (autoscaleUserId == null) { autoscaleUserId = CallContext.current().getCallingUserId(); } +======= +>>>>>>> a9148d9... CLOUDSTACK-3948: fixed createAutoscaleVmProfile - for situation when no autoscaleUserId is passed in, take it from caller user id, not caller account id AutoScaleVmProfileVO profileVO = new AutoScaleVmProfileVO(cmd.getZoneId(), cmd.getDomainId(), cmd.getAccountId(), cmd.getServiceOfferingId(), cmd.getTemplateId(), cmd.getOtherDeployParams(), cmd.getCounterParamList(), cmd.getDestroyVmGraceperiod(), autoscaleUserId); profileVO = checkValidityAndPersist(profileVO);