mirror of https://github.com/apache/cloudstack.git
Bug 8208 - bare metal provisioning
set useexternalDHCP to false when creating pod
This commit is contained in:
parent
5819e8fee0
commit
0810831fd2
|
|
@ -212,7 +212,6 @@ public class ApiConstants {
|
|||
public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress";
|
||||
public static final String PRIVATE_NETMASK = "privatenetmask";
|
||||
public static final String PRIVATE_NETWORK_ID = "privatenetworkid";
|
||||
public static final String USE_EXTERNAL_DHCP = "useexternaldhcp";
|
||||
public static final String PING_STORAGE_SERVER_IP = "pingstorageserverip";
|
||||
public static final String PING_DIR = "pingdir";
|
||||
public static final String TFTP_DIR = "tftpdir";
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@ public class CreatePodCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID in which the Pod will be created ")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.USE_EXTERNAL_DHCP, type=CommandType.BOOLEAN, description="whether use external dhcp server, true/false, default is false ")
|
||||
private Boolean useExternalDhcp;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -87,12 +84,7 @@ public class CreatePodCmd extends BaseCmd {
|
|||
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public Boolean getUseExternalDhcp() {
|
||||
return useExternalDhcp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
|
|
|
|||
|
|
@ -93,10 +93,9 @@ public interface ConfigurationManager extends ConfigurationService, Manager {
|
|||
* @param cidr
|
||||
* @param startIp
|
||||
* @param endIp
|
||||
* @param useExternalDhcp
|
||||
* @return Pod
|
||||
*/
|
||||
HostPodVO createPod(long userId, String podName, long zoneId, String gateway, String cidr, String startIp, String endIp, Boolean useExternalDhcp);
|
||||
HostPodVO createPod(long userId, String podName, long zoneId, String gateway, String cidr, String startIp, String endIp);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -684,14 +684,12 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
Long zoneId = cmd.getZoneId();
|
||||
String cidr = NetUtils.ipAndNetMaskToCidr(gateway, netmask);
|
||||
Long userId = UserContext.current().getCallerUserId();
|
||||
Boolean useExternalDhcp = cmd.getUseExternalDhcp();
|
||||
useExternalDhcp = (useExternalDhcp == null ? false : useExternalDhcp);
|
||||
|
||||
return createPod(userId.longValue(), name, zoneId, gateway, cidr, startIp, endIp, useExternalDhcp);
|
||||
return createPod(userId.longValue(), name, zoneId, gateway, cidr, startIp, endIp);
|
||||
}
|
||||
|
||||
@Override @DB
|
||||
public HostPodVO createPod(long userId, String podName, long zoneId, String gateway, String cidr, String startIp, String endIp, Boolean useExternalDhcp) {
|
||||
public HostPodVO createPod(long userId, String podName, long zoneId, String gateway, String cidr, String startIp, String endIp) {
|
||||
|
||||
// Check if the zone is valid
|
||||
if (!validZone(zoneId)) {
|
||||
|
|
@ -719,7 +717,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
throw new InvalidParameterValueException("Start ip is required parameter");
|
||||
}
|
||||
|
||||
HostPodVO pod = new HostPodVO(podName, zoneId, gateway, cidrAddress, cidrSize, ipRange, useExternalDhcp);
|
||||
HostPodVO pod = new HostPodVO(podName, zoneId, gateway, cidrAddress, cidrSize, ipRange);
|
||||
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@ public class HostPodVO implements Pod {
|
|||
@Column(name = "external_dhcp")
|
||||
private Boolean externalDhcp;
|
||||
|
||||
public HostPodVO(String name, long dcId, String gateway, String cidrAddress, int cidrSize, String description, Boolean externalDhcp) {
|
||||
public HostPodVO(String name, long dcId, String gateway, String cidrAddress, int cidrSize, String description) {
|
||||
this.name = name;
|
||||
this.dataCenterId = dcId;
|
||||
this.gateway = gateway;
|
||||
this.cidrAddress = cidrAddress;
|
||||
this.cidrSize = cidrSize;
|
||||
this.description = description;
|
||||
this.externalDhcp = externalDhcp;
|
||||
this.externalDhcp = false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
ipRange = "";
|
||||
}
|
||||
|
||||
HostPodVO pod = new HostPodVO(podName, zoneId, gateway, cidrAddress, cidrSize, ipRange, false);
|
||||
HostPodVO pod = new HostPodVO(podName, zoneId, gateway, cidrAddress, cidrSize, ipRange);
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
try {
|
||||
txn.start();
|
||||
|
|
|
|||
Loading…
Reference in New Issue