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);