rhtyd commented on a change in pull request #3425: [WIP DO NOT MERGE] Better
tracking host maintanence success and failure
URL: https://github.com/apache/cloudstack/pull/3425#discussion_r348934371
##########
File path: server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
##########
@@ -1212,14 +1216,21 @@ public boolean resourceStateTransitTo(final Host host,
final ResourceState.Event
private boolean doMaintain(final long hostId) {
final HostVO host = _hostDao.findById(hostId);
+ s_logger.info("Maintenance: attempting maintenance of host " +
host.getUuid());
+ ResourceState hostState = host.getResourceState();
+ if (hostState == ResourceState.PrepareForMaintenance || hostState ==
ResourceState.ErrorInPrepareForMaintenance ||
Review comment:
Same as before, using `Array/list::contains()` or equivalent. If this is
frequenty used code, refactor as a separate internal method and re-use wherever
needed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services