CLOUDSTACK-2155 Anti-Affinity -When Vm deployment is done in parallel , anti-affinity rule is not honored.

- Changes to the API Cmd needed to use CallContext instead of UserContext
This commit is contained in:
Prachi Damle 2013-07-16 13:17:43 -07:00
parent aa131525ba
commit 686f9ae64f
1 changed files with 3 additions and 3 deletions

View File

@ -22,10 +22,10 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.context.CallContext;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
@APICommand(name = "cleanVMReservations", description = "Cleanups VM reservations in the database.", responseObject = SuccessResponse.class)
public class CleanVMReservationsCmd extends BaseAsyncCmd {
@ -49,7 +49,7 @@ public class CleanVMReservationsCmd extends BaseAsyncCmd {
@Override
public long getEntityOwnerId() {
Account account = UserContext.current().getCaller();
Account account = CallContext.current().getCallingAccount();
if (account != null) {
return account.getId();
}