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

    https://github.com/apache/cloudstack/pull/1094#discussion_r46114646
  
    --- Diff: 
plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
 ---
    @@ -102,11 +112,11 @@ public NiciraNvpGuestNetworkGuru() {
         @Override
         protected boolean canHandle(final NetworkOffering offering, final 
NetworkType networkType, final PhysicalNetwork physicalNetwork) {
             // This guru handles only Guest Isolated network that supports 
Source nat service
    -        if (networkType == NetworkType.Advanced && 
isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == 
Network.GuestType.Isolated
    +        if (networkType == NetworkType.Advanced && 
isMyTrafficType(offering.getTrafficType())
    +                && (offering.getGuestType() == Network.GuestType.Isolated 
|| offering.getGuestType() == Network.GuestType.Shared)
    --- End diff --
    
    Is this check really needed? I mean `Isolated` and `Shared` are the [only 
two types of guest 
networks](https://github.com/apache/cloudstack/blob/95ae7963d5652595d62d6ace39de2eec9670413c/api/src/com/cloud/network/Network.java#L41).
    If you would like to keep the check for sake of being future proof (that 
is, new guest types being added), then refactoring it to a method with a 
meaningful name (e.g. supportedGuestTypes(...)) would help readability.


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