cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cloudstack] rhtyd commented on a change in pull request #3425: [WIP DO NOT MERGE] Better tracking host maintanence success and failure
Date Thu, 21 Nov 2019 07:50:24 GMT
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_r348934807
 
 

 ##########
 File path: server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
 ##########
 @@ -1286,12 +1288,31 @@ public Host maintain(final PrepareForMaintenanceCmd cmd) {
             throw new InvalidParameterValueException("Unable to find host with ID: " + hostId
+ ". Please specify a valid host ID.");
         }
 
-        if (_hostDao.countBy(host.getClusterId(), ResourceState.PrepareForMaintenance, ResourceState.ErrorInMaintenance)
> 0) {
-            throw new InvalidParameterValueException("There are other servers in PrepareForMaintenance
OR ErrorInMaintenance STATUS in cluster " + host.getClusterId());
+        final ResourceState hostState = host.getResourceState();
+        if (hostState == ResourceState.Maintenance || hostState == ResourceState.PrepareForMaintenance
||
 
 Review comment:
   Same as above use a array/list::contains() and refactor/reuse as an internal check method.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message