DK101010 commented on a change in pull request #4399:
URL: https://github.com/apache/cloudstack/pull/4399#discussion_r542363880



##########
File path: engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
##########
@@ -480,6 +482,25 @@ public Integer countAllByTypeInZone(long zoneId, Type 
type) {
         return listBy(sc);
     }
 
+    @Override
+    public boolean checkHostServiceOfferingTags(HostVO host, ServiceOffering 
serviceOffering){
+        if (host == null) {
+            return false;
+        }
+        if (serviceOffering == null) {
+            return false;
+        }
+        if (Strings.isNullOrEmpty(serviceOffering.getHostTag())) {
+            return true;
+        }
+
+        List<String> serviceOfferingTags = 
Arrays.asList(serviceOffering.getHostTag().split(","));
+        if(host.getHostTags() != null && 
host.getHostTags().containsAll(serviceOfferingTags)){
+            return true;
+        }
+        return false;
+    }

Review comment:
       is moved ;)




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


Reply via email to