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

    https://github.com/apache/cloudstack/pull/1257#discussion_r54359804
  
    --- Diff: vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java ---
    @@ -1110,4 +1148,39 @@ public String getNetworkName(String netMorVal) 
throws Exception {
             }
             return networkName;
         }
    +
    +    public void createPortGroup(HostPortGroupSpec spec) throws Exception {
    +        if (spec == null) {
    +            return;
    +        }
    +
    +        synchronized (_mor.getValue().intern()) {
    +            HostNetworkSystemMO hostNetMo = getHostNetworkSystemMO();
    +            if (hostNetMo == null) {
    +                return;
    +            }
    +
    +            ManagedObjectReference morNetwork = 
getNetworkMor(spec.getName());
    +            if (morNetwork == null) {
    +                hostNetMo.addPortGroup(spec);
    +            }
    +        }
    +    }
    +
    +    public void copyPortGroupsFromHost(HostMO srcHost) throws Exception {
    +        if (srcHost == null) {
    +            return;
    +        }
    +
    +        List<HostPortGroupSpec> portGroupSpecs = 
srcHost.getHostPortGroupSpecs();
    +        if (portGroupSpecs == null || portGroupSpecs.isEmpty()) {
    --- End diff --
    
    Hi @sureshanaparti, could you please use CollectionUtils.isEmpty?
    It checks if the List is empty, returning true in case of null. 
(https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/CollectionUtils.html#isEmpty%28java.util.Collection%29)
    Thanks.


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