mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									5595a099b2
								
							
						
					
					
						commit
						9b7c4a6c47
					
				@ -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();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user