|
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; |
@@ -1020,7 +1020,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe |
1020 | 1020 | @Inject |
1021 | 1021 | StoragePoolTagsDao storagePoolTagsDao; |
1022 | 1022 | @Inject |
1023 | | - protected ManagementServerJoinDao _managementServerJoinDao; |
| 1023 | + protected ManagementServerJoinDao managementServerJoinDao; |
1024 | 1024 |
|
1025 | 1025 | @Inject |
1026 | 1026 | private PublicIpQuarantineDao publicIpQuarantineDao; |
@@ -4047,7 +4047,7 @@ public List<Class<?>> getCommands() { |
4047 | 4047 | cmdList.add(ListTemplateDirectDownloadCertificatesCmd.class); |
4048 | 4048 | cmdList.add(ProvisionTemplateDirectDownloadCertificateCmd.class); |
4049 | 4049 | cmdList.add(ListMgmtsCmd.class); |
4050 | | - cmdList.add(RemoveMgmtCmd.class); |
| 4050 | + cmdList.add(RemoveManagementServerCmd.class); |
4051 | 4051 | cmdList.add(GetUploadParamsForIsoCmd.class); |
4052 | 4052 | cmdList.add(GetRouterHealthCheckResultsCmd.class); |
4053 | 4053 | cmdList.add(StartRollingMaintenanceCmd.class); |
@@ -5562,20 +5562,20 @@ public void setLockControllerListener(final LockControllerListener lockControlle |
5562 | 5562 | @Override |
5563 | 5563 | @DB |
5564 | 5564 | @ActionEvent(eventType = EventTypes.EVENT_MANAGEMENT_SERVER_REMOVE, eventDescription = "removing Management Server") |
5565 | | - public boolean removeManagementServer(RemoveMgmtCmd cmd) { |
| 5565 | + public boolean removeManagementServer(RemoveManagementServerCmd cmd) { |
5566 | 5566 | final Long id = cmd.getId(); |
5567 | | - ManagementServerJoinVO managementServer = _managementServerJoinDao.findById(id); |
| 5567 | + ManagementServerJoinVO managementServer = managementServerJoinDao.findById(id); |
5568 | 5568 |
|
5569 | 5569 | if (managementServer == null) { |
5570 | 5570 | throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s]", managementServer.getUuid())); |
5571 | 5571 | } |
5572 | 5572 |
|
5573 | | - if (ManagementServerHost.State.Up.equals(managementServer.getState())) { |
| 5573 | + if (!ManagementServerHost.State.Down.equals(managementServer.getState())) { |
5574 | 5574 | 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())); |
5575 | 5575 | } |
5576 | 5576 |
|
5577 | 5577 | managementServer.setRemoved(new Date()); |
5578 | | - return _managementServerJoinDao.update(id, managementServer); |
| 5578 | + return managementServerJoinDao.update(id, managementServer); |
5579 | 5579 |
|
5580 | 5580 | } |
5581 | 5581 |
|
|
0 commit comments