Skip to content

Commit f5e79d9

Browse files
nicoschmdtbernardodemarco
authored andcommitted
Apply suggestions from code review
Co-authored-by: Bernardo De Marco Gonçalves <[email protected]>
1 parent 4a95667 commit f5e79d9

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
@@ -5502,17 +5502,17 @@ public void setLockControllerListener(final LockControllerListener lockControlle
55025502

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

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

55145514
if (ManagementServerHost.State.Up.equals(managementServer.getState())) {
5515-
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()));
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()));
55165516
}
55175517

55185518
managementServer.setRemoved(new Date());

0 commit comments

Comments
 (0)