Updated Branches:
  refs/heads/master 5595a099b -> 9b7c4a6c4

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


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9b7c4a6c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9b7c4a6c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9b7c4a6c

Branch: refs/heads/master
Commit: 9b7c4a6c476fbcafb1cbad81a699cea3f55ad4f2
Parents: 5595a09
Author: Alena Prokharchyk <[email protected]>
Authored: Tue Jul 30 14:11:29 2013 -0700
Committer: Alena Prokharchyk <[email protected]>
Committed: Tue Jul 30 14:13:58 2013 -0700

----------------------------------------------------------------------
 .../api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java | 4 ++--
 server/src/com/cloud/network/as/AutoScaleManagerImpl.java       | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b7c4a6c/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 3b5567d..192185e 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();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b7c4a6c/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 213ff67..8c8a805 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<Type> 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<Type> 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);

Reply via email to