mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-21 13:03:10 +01:00
engine/orchestartion: fix/refactor to Account.Type.ADMIN
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
0c192f3609
commit
c8f02a8b34
@ -842,7 +842,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
} catch (final InsufficientCapacityException e) {
|
||||
final CallContext cctxt = CallContext.current();
|
||||
final Account account = cctxt.getCallingAccount();
|
||||
if (account.getType() == Account.ACCOUNT_TYPE_ADMIN) {
|
||||
if (account.getType() == Account.Type.ADMIN) {
|
||||
throw new CloudRuntimeException("Unable to start a VM due to insufficient capacity: " + e.getMessage(), e).add(VirtualMachine.class, vmUuid);
|
||||
}
|
||||
throw new CloudRuntimeException("Unable to start a VM due to insufficient capacity", e).add(VirtualMachine.class, vmUuid);
|
||||
@ -1230,7 +1230,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
reuseVolume = false;
|
||||
continue;
|
||||
}
|
||||
if (account.getType() == Account.ACCOUNT_TYPE_ADMIN && adminError != null) {
|
||||
if (account.getType() == Account.Type.ADMIN && adminError != null) {
|
||||
String message = String.format("Unable to create a deployment for %s. Previous error: %s", vmProfile, adminError);
|
||||
throw new InsufficientServerCapacityException(message, DataCenter.class, plan.getDataCenterId(), areAffinityGroupsAssociated(vmProfile));
|
||||
}
|
||||
@ -1470,7 +1470,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
}
|
||||
|
||||
if (startedVm == null) {
|
||||
if (account.getType() == Account.ACCOUNT_TYPE_ADMIN && adminError != null) {
|
||||
if (account.getType() == Account.Type.ADMIN && adminError != null) {
|
||||
throw new CloudRuntimeException("Unable to start instance '" + vm.getHostName() + "' (" + vm.getUuid() + "): " + adminError);
|
||||
}
|
||||
throw new CloudRuntimeException("Unable to start instance '" + vm.getHostName() + "' (" + vm.getUuid() + "), see management server log for details");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user