You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2014/01/11 00:42:37 UTC
git commit: updated refs/heads/4.3 to 1f9ad23
Updated Branches:
refs/heads/4.3 ec191455f -> 1f9ad23ba
CLOUDSTACK-5502 createVlanIpRange, allow untagged to be accepted per previous use,
equate empty string to untagged in api parameter input
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1f9ad23b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1f9ad23b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1f9ad23b
Branch: refs/heads/4.3
Commit: 1f9ad23ba0920700b93cec0ce5f0226ae3c81952
Parents: ec19145
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Fri Jan 10 16:30:43 2014 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Fri Jan 10 16:30:43 2014 -0700
----------------------------------------------------------------------
.../cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java | 3 +++
.../src/com/cloud/configuration/ConfigurationManagerImpl.java | 5 +----
utils/src/com/cloud/utils/net/NetUtils.java | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f9ad23b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
index 541da1e..9dd448d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
@@ -144,6 +144,9 @@ public class CreateVlanIpRangeCmd extends BaseCmd {
}
public String getVlan() {
+ if (vlan.isEmpty()) {
+ vlan = "untagged";
+ }
return vlan;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f9ad23b/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 f9d282f..99f2c19 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2480,8 +2480,6 @@ ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, Co
String newVlanNetmask = cmd.getNetmask();
String vlanId = cmd.getVlan();
// TODO decide if we should be forgiving or demand a valid and complete URI
- if (NetUtils.isSameIsolationId(Vlan.UNTAGGED, vlanId))
- vlanId = null;
if (!((vlanId == null)
|| ("".equals(vlanId))
|| vlanId.startsWith(BroadcastDomainType.Vlan.scheme())))
@@ -2923,8 +2921,7 @@ ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, Co
vlanId = networkVlanId;
}
} else if (network.getTrafficType() == TrafficType.Public && vlanId == null) {
- // vlan id is required for public network
- throw new InvalidParameterValueException("Vlan id is required when add ip range to the public network");
+ throw new InvalidParameterValueException("Unable to determine vlan id or untagged vlan for public network");
}
if (vlanId == null) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f9ad23b/utils/src/com/cloud/utils/net/NetUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java
index e6879bf..a72aded 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -1420,7 +1420,7 @@ public class NetUtils {
return false;
}
// check 'untagged'
- if (VLAN_UNTAGGED.equalsIgnoreCase(one) && VLAN_UNTAGGED.equalsIgnoreCase(other))
+ if (one.contains(VLAN_UNTAGGED) && other.contains(VLAN_UNTAGGED))
{
return true;
}