sgoeminn commented on a change in pull request #2293: CLOUDSTACK-10047: 
DVSwitch fixes and improvements
URL: https://github.com/apache/cloudstack/pull/2293#discussion_r144576505
 
 

 ##########
 File path: 
vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
 ##########
 @@ -501,12 +510,18 @@ public static void updatePortProfile(VmwareContext 
context, String ethPortProfil
             // No doubt about this, depending on vid=null to avoid lots of 
code below
             vid = null;
         } else {
+            if (vlanId != null) {
+                vlanId = vlanId.replace("vlan://", "");
+            }
             networkName = composeCloudNetworkName(namePrefix, vlanId, 
secondaryvlanId, networkRateMbps, physicalNetwork);
 
-            if (vlanId != null && 
!UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
+            if (vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId) 
&& !vlanId.contains(",") && !vlanId.contains("-")) {
                 createGCTag = true;
                 vid = Integer.parseInt(vlanId);
             }
+            if (vlanId != null && (vlanId.contains(",") || 
vlanId.contains("-"))) {
 
 Review comment:
   could be replaced by  StringUtils.containsAny(vlanId, ",-")? Maybe also 
extract it to a separate boolean because it's checked multiple times?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to