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:
Alena Prokharchyk 2013-07-30 14:11:29 -07:00
parent 5595a099b2
commit 9b7c4a6c47
2 changed files with 6 additions and 3 deletions

View File

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

View File

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