Skip to content

Commit 093efee

Browse files
Apply suggestions from code review
Co-authored-by: Bernardo De Marco Gonçalves <[email protected]>
1 parent b564c50 commit 093efee

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/management/RemoveMgmtCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
import com.cloud.exception.ResourceAllocationException;
3535
import com.cloud.exception.ResourceUnavailableException;
3636

37-
@APICommand(name = "removeManagementServer", description = "Removes a management server.", responseObject = SuccessResponse.class,
37+
@APICommand(name = "removeManagementServer", description = "Removes a Management Server.", responseObject = SuccessResponse.class,
3838
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = RoleType.Admin)
3939
public class RemoveMgmtCmd extends BaseCmd {
4040

41-
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ManagementServerResponse.class, required = true, description = "the id of the management server")
41+
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ManagementServerResponse.class, required = true, description = "the ID of the Management Server")
4242
private Long id;
4343

4444
public Long getId() {
@@ -52,7 +52,7 @@ public void execute() throws ResourceUnavailableException, InsufficientCapacityE
5252
SuccessResponse response = new SuccessResponse(getCommandName());
5353
this.setResponseObject(response);
5454
} else {
55-
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove management server");
55+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove Management Server");
5656
}
5757
}
5858

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5504,17 +5504,17 @@ public void setLockControllerListener(final LockControllerListener lockControlle
55045504

55055505
@Override
55065506
@DB
5507-
@ActionEvent(eventType = EventTypes.EVENT_MANAGEMENT_SERVER_REMOVE, eventDescription = "removing management server")
5507+
@ActionEvent(eventType = EventTypes.EVENT_MANAGEMENT_SERVER_REMOVE, eventDescription = "removing Management Server")
55085508
public boolean removeManagementServer(RemoveMgmtCmd cmd) {
55095509
final Long id = cmd.getId();
55105510
ManagementServerJoinVO managementServer = _managementServerJoinDao.findById(id);
55115511

55125512
if (managementServer == null) {
5513-
throw new InvalidParameterValueException(String.format("Unable to find the management server for specified id [%s]", managementServer.getUuid()));
5513+
throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s]", managementServer.getUuid()));
55145514
}
55155515

55165516
if (ManagementServerHost.State.Up.equals(managementServer.getState())) {
5517-
throw new InvalidParameterValueException(String.format("Unable to remove management server [%s], it is not in the right state, it can only be removed when state is [%s]", managementServer.getUuid(), ManagementServerHost.State.Down.name()));
5517+
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()));
55185518
}
55195519

55205520
managementServer.setRemoved(new Date());

0 commit comments

Comments
 (0)