Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1371#discussion_r62780405
  
    --- Diff: 
engine/schema/src/com/cloud/network/vpc/dao/VpcServiceMapDaoImpl.java ---
    @@ -62,7 +62,31 @@ protected VpcServiceMapDaoImpl() {
     
         @Override
         public boolean areServicesSupportedInVpc(long vpcId, Service... 
services) {
    -        // TODO Auto-generated method stub
    +        SearchCriteria<VpcServiceMapVO> sc = 
MultipleServicesSearch.create();
    +        sc.setParameters("vpcId", vpcId);
    +
    +        if (services != null) {
    +            String[] servicesStr = new String[services.length];
    +
    +            int i = 0;
    +            for (Service service : services) {
    +                servicesStr[i] = service.getName();
    +                i++;
    +            }
    +
    +            sc.setParameters("service", (Object[])servicesStr);
    +        }
    +
    +        List<VpcServiceMapVO> vpcServices = listBy(sc);
    +
    +        if (services != null) {
    +            if (vpcServices.size() == services.length) {
    --- End diff --
    
    What if the size of ``vpcServices`` and ``services`` are equal, but they 
contain different elements?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to