mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-3948: fixed createAutoscaleVmProfile - for situation when no autoscaleUserId is passed in, take it from caller user id, not caller account id
This commit is contained in:
parent
4527227360
commit
026cca46c6
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,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);
|
||||
|
||||
|
|
@ -336,10 +336,6 @@ public class AutoScaleManagerImpl<Type> 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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue