|
127 | 127 | import org.apache.cloudstack.api.command.admin.iso.RegisterIsoCmdByAdmin; |
128 | 128 | import org.apache.cloudstack.api.command.admin.loadbalancer.ListLoadBalancerRuleInstancesCmdByAdmin; |
129 | 129 | import org.apache.cloudstack.api.command.admin.management.ListMgmtsCmd; |
130 | | -import org.apache.cloudstack.api.command.admin.management.RemoveMgmtCmd; |
| 130 | +import org.apache.cloudstack.api.command.admin.management.RemoveManagementServerCmd; |
131 | 131 | import org.apache.cloudstack.api.command.admin.network.AddNetworkDeviceCmd; |
132 | 132 | import org.apache.cloudstack.api.command.admin.network.AddNetworkServiceProviderCmd; |
133 | 133 | import org.apache.cloudstack.api.command.admin.network.CreateManagementNetworkIpRangeCmd; |
@@ -1016,7 +1016,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe |
1016 | 1016 | @Inject |
1017 | 1017 | StoragePoolTagsDao storagePoolTagsDao; |
1018 | 1018 | @Inject |
1019 | | - protected ManagementServerJoinDao _managementServerJoinDao; |
| 1019 | + protected ManagementServerJoinDao managementServerJoinDao; |
1020 | 1020 |
|
1021 | 1021 | @Inject |
1022 | 1022 | private PublicIpQuarantineDao publicIpQuarantineDao; |
@@ -4001,7 +4001,7 @@ public List<Class<?>> getCommands() { |
4001 | 4001 | cmdList.add(ListTemplateDirectDownloadCertificatesCmd.class); |
4002 | 4002 | cmdList.add(ProvisionTemplateDirectDownloadCertificateCmd.class); |
4003 | 4003 | cmdList.add(ListMgmtsCmd.class); |
4004 | | - cmdList.add(RemoveMgmtCmd.class); |
| 4004 | + cmdList.add(RemoveManagementServerCmd.class); |
4005 | 4005 | cmdList.add(GetUploadParamsForIsoCmd.class); |
4006 | 4006 | cmdList.add(GetRouterHealthCheckResultsCmd.class); |
4007 | 4007 | cmdList.add(StartRollingMaintenanceCmd.class); |
@@ -5503,20 +5503,20 @@ public void setLockControllerListener(final LockControllerListener lockControlle |
5503 | 5503 | @Override |
5504 | 5504 | @DB |
5505 | 5505 | @ActionEvent(eventType = EventTypes.EVENT_MANAGEMENT_SERVER_REMOVE, eventDescription = "removing Management Server") |
5506 | | - public boolean removeManagementServer(RemoveMgmtCmd cmd) { |
| 5506 | + public boolean removeManagementServer(RemoveManagementServerCmd cmd) { |
5507 | 5507 | final Long id = cmd.getId(); |
5508 | | - ManagementServerJoinVO managementServer = _managementServerJoinDao.findById(id); |
| 5508 | + ManagementServerJoinVO managementServer = managementServerJoinDao.findById(id); |
5509 | 5509 |
|
5510 | 5510 | if (managementServer == null) { |
5511 | 5511 | throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s]", managementServer.getUuid())); |
5512 | 5512 | } |
5513 | 5513 |
|
5514 | | - if (ManagementServerHost.State.Up.equals(managementServer.getState())) { |
| 5514 | + if (!ManagementServerHost.State.Down.equals(managementServer.getState())) { |
5515 | 5515 | throw new InvalidParameterValueException(String.format("Unable to remove Management Server with ID [%s]. It can only be removed when it is in the [%s] state, however currently it is in the [%s] state", managementServer.getUuid(), ManagementServerHost.State.Down.name(), ManagementServerHost.State.Up.name())); |
5516 | 5516 | } |
5517 | 5517 |
|
5518 | 5518 | managementServer.setRemoved(new Date()); |
5519 | | - return _managementServerJoinDao.update(id, managementServer); |
| 5519 | + return managementServerJoinDao.update(id, managementServer); |
5520 | 5520 |
|
5521 | 5521 | } |
5522 | 5522 |
|
|
0 commit comments