PVLAN: Check BroadcastDomainType before extract pvlan tag


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8ee4f6c0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8ee4f6c0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8ee4f6c0

Branch: refs/heads/pvlan
Commit: 8ee4f6c080062632473c214b6fe896148e3d56e3
Parents: eb7c321
Author: Sheng Yang <[email protected]>
Authored: Tue May 7 14:49:50 2013 -0700
Committer: Sheng Yang <[email protected]>
Committed: Mon May 20 17:38:09 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/configuration/ConfigurationManagerImpl.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8ee4f6c0/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java 
b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 47c5482..7bd90b2 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2689,8 +2689,9 @@ public class ConfigurationManagerImpl extends ManagerBase 
implements Configurati
             if (uri != null) {
                 String[] vlan = uri.toString().split("vlan:\\/\\/");
                 networkVlanId = vlan[1];
-                //For pvlan
-                networkVlanId = networkVlanId.split("-")[0];
+                if (network.getBroadcastDomainType() == 
BroadcastDomainType.Pvlan) {
+                       networkVlanId = networkVlanId.split("-")[0];
+                }
             }
 
             if (vlanId != null) {

Reply via email to