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:
Alena Prokharchyk 2013-07-30 14:11:29 -07:00
parent 4527227360
commit 026cca46c6
2 changed files with 3 additions and 7 deletions

View File

@ -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();
}
}

View File

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