rafaelweingartner commented on a change in pull request #2379: 
CLOUDSTACK-10146: Bypass Secondary Storage for KVM templates
URL: https://github.com/apache/cloudstack/pull/2379#discussion_r159630681
 
 

 ##########
 File path: server/src/com/cloud/resource/ResourceManagerImpl.java
 ##########
 @@ -2797,6 +2798,23 @@ public void updateGPUDetails(final long hostId, final 
HashMap<String, HashMap<St
         return null;
     }
 
+    @Override
+    public HostVO findOneRandomRunningHostByHypervisor(HypervisorType type) {
+        final QueryBuilder<HostVO> sc = QueryBuilder.create(HostVO.class);
+        sc.and(sc.entity().getHypervisorType(), Op.EQ, type);
+        sc.and(sc.entity().getType(),Op.EQ, Type.Routing);
+        sc.and(sc.entity().getStatus(), Op.EQ, Status.Up);
+        sc.and(sc.entity().getResourceState(), Op.EQ, ResourceState.Enabled);
+        sc.and(sc.entity().getRemoved(), Op.NULL);
+        List<HostVO> hosts = sc.list();
+        if (hosts == null || hosts.isEmpty()) {
 
 Review comment:
   CollectionUtils.isEmpty

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to