rhtyd commented on a change in pull request #3795: Agent lb on svm
URL: https://github.com/apache/cloudstack/pull/3795#discussion_r363611791
 
 

 ##########
 File path: 
server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java
 ##########
 @@ -136,17 +144,48 @@ public int compare(Long x, Long y) {
         }
         final List <Host> agentBasedHosts = new ArrayList<>();
         for (final Host host : allHosts) {
-            if (host == null || host.getResourceState() == 
ResourceState.Creating || host.getResourceState() == ResourceState.Error) {
-                continue;
+            conditionallyAddHost(agentBasedHosts, host);
+        }
+        return agentBasedHosts;
+    }
+
+    private void conditionallyAddHost(List<Host> agentBasedHosts, Host host) {
+        if (host == null) {
 
 Review comment:
   We can do null checks and if host is removed or is some unsupported state 
like error etc.?

----------------------------------------------------------------
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

Reply via email to