Skip to content

Commit 686f9ae

Browse files
author
Prachi Damle
committed
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
1 parent aa13152 commit 686f9ae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎api/src/org/apache/cloudstack/api/command/admin/resource/CleanVMReservationsCmd.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import org.apache.cloudstack.api.ServerApiException;
2323
import org.apache.cloudstack.api.response.SuccessResponse;
2424
import org.apache.log4j.Logger;
25-
25+
import org.apache.cloudstack.context.CallContext;
2626
import com.cloud.event.EventTypes;
2727
import com.cloud.user.Account;
28-
import com.cloud.user.UserContext;
28+
2929

3030
@APICommand(name = "cleanVMReservations", description = "Cleanups VM reservations in the database.", responseObject = SuccessResponse.class)
3131
public class CleanVMReservationsCmd extends BaseAsyncCmd {
@@ -49,7 +49,7 @@ public String getCommandName() {
4949

5050
@Override
5151
public long getEntityOwnerId() {
52-
Account account = UserContext.current().getCaller();
52+
Account account = CallContext.current().getCallingAccount();
5353
if (account != null) {
5454
return account.getId();
5555
}

0 commit comments

Comments
 (0)