IPv6: Make the IPv6 input all lowercase
To make them consistent.
Conflicts:
api/src/com/cloud/api/commands/DeployVMCmd.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit:
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/66ee943c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/66ee943c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/66ee943c
Branch: refs/heads/network-refactor
Commit: 66ee943c775ab3a4d91d2138ab2f86c4280c6f39
Parents: 462a479
Author: Sheng Yang <[email protected]>
Authored: Tue Jan 29 19:47:08 2013 -0800
Committer: Sheng Yang <[email protected]>
Committed: Wed Jan 30 23:47:02 2013 -0800
----------------------------------------------------------------------
api/src/com/cloud/api/ApiConstants.java | 4 +-
.../com/cloud/api/commands/CreateNetworkCmd.java | 44 ++++++---------
2 files changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/66ee943c/api/src/com/cloud/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/ApiConstants.java
b/api/src/com/cloud/api/ApiConstants.java
index d10e10d..fa8c979 100755
--- a/api/src/com/cloud/api/ApiConstants.java
+++ b/api/src/com/cloud/api/ApiConstants.java
@@ -38,7 +38,7 @@ public class ApiConstants {
public static final String DOMAIN_SUFFIX = "domainsuffix";
public static final String DNS_SEARCH_ORDER = "dnssearchorder";
public static final String CIDR = "cidr";
- public static final String IP6CIDR = "ip6cidr";
+ public static final String IP6_CIDR = "ip6cidr";
public static final String CIDR_LIST = "cidrlist";
public static final String CLEANUP = "cleanup";
public static final String CLUSTER_ID = "clusterid";
@@ -75,7 +75,7 @@ public class ApiConstants {
public static final String FORMAT = "format";
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
public static final String GATEWAY = "gateway";
- public static final String IP6GATEWAY = "ip6gateway";
+ public static final String IP6_GATEWAY = "ip6gateway";
public static final String GROUP = "group";
public static final String GROUP_ID = "groupid";
public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/66ee943c/api/src/com/cloud/api/commands/CreateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateNetworkCmd.java
b/api/src/com/cloud/api/commands/CreateNetworkCmd.java
index 60aaf59..1f214b5 100644
--- a/api/src/com/cloud/api/commands/CreateNetworkCmd.java
+++ b/api/src/com/cloud/api/commands/CreateNetworkCmd.java
@@ -113,11 +113,11 @@ public class CreateNetworkCmd extends BaseCmd {
@Parameter(name=ApiConstants.END_IPV6, type=CommandType.STRING,
description="the ending IPv6 address in the IPv6 network range")
private String endIpv6;
- @Parameter(name=ApiConstants.IP6GATEWAY, type=CommandType.STRING,
description="the gateway of the IPv6 network. Required " +
+ @Parameter(name=ApiConstants.IP6_GATEWAY, type=CommandType.STRING,
description="the gateway of the IPv6 network. Required " +
"for Shared networks and Isolated networks when it belongs to VPC")
private String ip6Gateway;
- @Parameter(name=ApiConstants.IP6CIDR, type=CommandType.STRING,
description="the CIDR of IPv6 network, must be at least /64")
+ @Parameter(name=ApiConstants.IP6_CIDR, type=CommandType.STRING,
description="the CIDR of IPv6 network, must be at least /64")
private String ip6Cidr;
@Parameter(name=ApiConstants.DUAL_STACK, type=CommandType.BOOLEAN,
description="The network is dual-stack(IPv6 and IPv4) or not")
@@ -217,35 +217,31 @@ public class CreateNetworkCmd extends BaseCmd {
}
public String getStartIpv6() {
- return startIpv6;
- }
-
- public void setStartIpv6(String startIpv6) {
- this.startIpv6 = startIpv6;
+ if (startIpv6 == null) {
+ return null;
+ }
+ return startIpv6.toLowerCase();
}
public String getEndIpv6() {
- return endIpv6;
- }
-
- public void setEndIpv6(String endIpv6) {
- this.endIpv6 = endIpv6;
+ if (endIpv6 == null) {
+ return null;
+ }
+ return endIpv6.toLowerCase();
}
public String getIp6Gateway() {
- return ip6Gateway;
- }
-
- public void setIp6Gateway(String ip6Gateway) {
- this.ip6Gateway = ip6Gateway;
+ if (ip6Gateway == null) {
+ return null;
+ }
+ return ip6Gateway.toLowerCase();
}
public String getIp6Cidr() {
- return ip6Cidr;
- }
-
- public void setIp6Cidr(String ip6Cidr) {
- this.ip6Cidr = ip6Cidr;
+ if (ip6Cidr == null) {
+ return null;
+ }
+ return ip6Cidr.toLowerCase();
}
public Boolean isDualStack() {
@@ -255,10 +251,6 @@ public class CreateNetworkCmd extends BaseCmd {
return dualStack;
}
- public void setDualStack(Boolean dualStack) {
- this.dualStack = dualStack;
- }
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////