Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
  • Loading branch information
nicoschmdt and winterhazel authored Feb 21, 2025
1 parent 9efb35d commit 77aa0a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void execute() throws ResourceUnavailableException, InsufficientCapacityE
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove Management Server");
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove Management Server.");

Check warning on line 55 in api/src/main/java/org/apache/cloudstack/api/command/admin/management/RemoveManagementServerCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/admin/management/RemoveManagementServerCmd.java#L52-L55

Added lines #L52 - L55 were not covered by tests
}
}

Check warning on line 57 in api/src/main/java/org/apache/cloudstack/api/command/admin/management/RemoveManagementServerCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/admin/management/RemoveManagementServerCmd.java#L57

Added line #L57 was not covered by tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5508,11 +5508,11 @@ public boolean removeManagementServer(RemoveManagementServerCmd cmd) {
ManagementServerJoinVO managementServer = managementServerJoinDao.findById(id);

if (managementServer == null) {

Check warning on line 5510 in server/src/main/java/com/cloud/server/ManagementServerImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L5510 was not covered by tests
throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s]", managementServer.getUuid()));
throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s].", managementServer.getUuid()));
}

if (!ManagementServerHost.State.Down.equals(managementServer.getState())) {

Check warning on line 5514 in server/src/main/java/com/cloud/server/ManagementServerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/server/ManagementServerImpl.java#L5513-L5514

Added lines #L5513 - L5514 were not covered by tests
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(), managementServer.getState().name()));
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(), managementServer.getState().name()));
}

Check warning on line 5516 in server/src/main/java/com/cloud/server/ManagementServerImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L5516 was not covered by tests

managementServer.setRemoved(new Date());
Expand Down

0 comments on commit 77aa0a8

Please sign in to comment.