cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GabrielBrascher <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-9175: [VMware DRS] Adding new ...
Date Mon, 29 Feb 2016 00:08:32 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message