IPv6: Remove dualstack parameter from createNetworkCmd

We can tell if it's dual stack by looking into the startIp and startIpv6.
This commit is contained in:
Sheng Yang 2013-01-30 13:28:46 -08:00
parent c57b03d7dc
commit 5e3408ee4a
3 changed files with 2 additions and 15 deletions

View File

@ -425,7 +425,6 @@ public class ApiConstants {
public static final String CONDITION_IDS = "conditionids";
public static final String COUNTERPARAM_LIST = "counterparam";
public static final String AUTOSCALE_USER_ID = "autoscaleuserid";
public static final String DUAL_STACK = "dualstack";
public enum HostDetails {
all, capacity, events, stats, min;

View File

@ -120,9 +120,6 @@ public class CreateNetworkCmd extends BaseCmd {
@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")
private Boolean dualStack;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -244,13 +241,6 @@ public class CreateNetworkCmd extends BaseCmd {
return ip6Cidr.toLowerCase();
}
public Boolean isDualStack() {
if (dualStack == null) {
return false;
}
return dualStack;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

View File

@ -648,7 +648,6 @@ public class NetworkServiceImpl implements NetworkService, Manager {
String endIPv6 = cmd.getEndIpv6();
String ip6Gateway = cmd.getIp6Gateway();
String ip6Cidr = cmd.getIp6Cidr();
Boolean dualStack = cmd.isDualStack();
// Validate network offering
NetworkOfferingVO ntwkOff = _networkOfferingDao.findById(networkOfferingId);
@ -765,9 +764,8 @@ public class NetworkServiceImpl implements NetworkService, Manager {
UserContext.current().setAccountId(owner.getAccountId());
// VALIDATE IP INFO
if (startIPv6 != null && startIP != null && (dualStack == null || dualStack == false)) {
throw new InvalidParameterValueException("Cannot specify both IPv4 and IPv6 address without set dualStack = true!");
if (startIPv6 != null && startIP != null) {
throw new InvalidParameterValueException("Cannot support dualstack at this moment!");
}
boolean ipv4 = false, ipv6 = false;