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 01:09:53 UTC
git commit: updated refs/heads/master to 8ee61f3
Updated Branches:
refs/heads/master d76fccd8c -> 8ee61f3a5
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/8ee61f3a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8ee61f3a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8ee61f3a
Branch: refs/heads/master
Commit: 8ee61f3a578a2e40a04f9138c7dc77a3ec02e57b
Parents: d76fccd
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 17:09:41 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/8ee61f3a/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 dbaac6e..ca00382 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
@@ -147,6 +147,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/8ee61f3a/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 70ab196..9d148fa 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2381,8 +2381,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
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())))
vlanId = BroadcastDomainType.Vlan.toUri(vlanId).toString();
Boolean forVirtualNetwork = cmd.isForVirtualNetwork();
@@ -2798,8 +2796,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
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/8ee61f3a/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 0ea015b..8e994f1 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -1405,7 +1405,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;
}
// if one is a number check the other as number and as 'vlan://' + number