bug 10812: putting key in ZoneConfig and other nomenclature changes

This commit is contained in:
Abhinandan Prateek 2011-08-03 14:32:28 +05:30
parent 8a5a057231
commit cd78c5cb9b
7 changed files with 19 additions and 19 deletions

View File

@ -33,7 +33,7 @@ public class ApiConstants {
public static final String CERTIFICATE = "certificate";
public static final String PRIVATE_KEY = "privatekey";
public static final String DOMAIN_SUFFIX = "domainsuffix";
public static final String DOMAIN_SUFFIX_LIST = "domainsuffixlist";
public static final String DNS_SEARCH_ORDER = "dnssearchorder";
public static final String CIDR = "cidr";
public static final String CIDR_LIST = "cidrlist";
public static final String CLEANUP = "cleanup";

View File

@ -81,8 +81,8 @@ public class UpdateZoneCmd extends BaseCmd {
@Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone")
private String domain;
@Parameter(name=ApiConstants.DOMAIN_SUFFIX_LIST, type=CommandType.LIST, collectionType = CommandType.STRING, description="the list of domain suffixes for dns")
private List<String> domainSuffixList;
@Parameter(name=ApiConstants.DNS_SEARCH_ORDER, type=CommandType.LIST, collectionType = CommandType.STRING, description="the dns search order list")
private List<String> dnsSearchOrder;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
@ -140,8 +140,8 @@ public class UpdateZoneCmd extends BaseCmd {
return domain;
}
public List<String> getDomainSuffixList() {
return domainSuffixList;
public List<String> getDnsSearchOrder() {
return dnsSearchOrder;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////

View File

@ -252,9 +252,6 @@ dhcp-hostsfile=/etc/dhcphosts.txt
# Set the domain
dhcp-option=15,"2.vmops-test.vmops.com"
# Send RFC-3397 DNS domain search DHCP option.
#dhcp-option=119,"vmops.com"
# Send the etherboot magic flag and then etherboot options (a string).
#dhcp-option=128,e4:45:74:68:00:00
#dhcp-option=129,NIC=eepro100

View File

@ -267,9 +267,10 @@ setup_dnsmasq() {
echo "dhcp-option=6,$GUEST_GW" >> /etc/dnsmasq.conf
fi
if [ -n "$DOMAIN_SUFFIX" ]
if [ -n "$DNS_SEARCH_ORDER" ]
then
sed -i s/[#]*dhcp-option=119.*$/dhcp-option=119,\"$DOMAIN_SUFFIX\"/ /etc/dnsmasq.conf
sed -i -e "/^[#]*dhcp-option=119.*$/d" /etc/dnsmasq.conf
echo "dhcp-option=119,$DNS_SEARCH_ORDER" >> /etc/dnsmasq.conf
fi
if [ "$USE_EXTERNAL_DNS" == "true" ]
@ -550,8 +551,8 @@ for i in $CMDLINE
domain)
DOMAIN=$VALUE
;;
domainsuffix)
DOMAIN_SUFFIX=$VALUE
dnssearchorder)
DNS_SEARCH_ORDER=$VALUE
;;
useextdns)
USE_EXTERNAL_DNS=$VALUE

View File

@ -1156,7 +1156,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
String internalDns2 = cmd.getInternalDns2();
String vnetRange = cmd.getVlan();
String guestCidr = cmd.getGuestCidrAddress();
List<String> domainSuffixList = cmd.getDomainSuffixList();
List<String> dnsSearchOrder = cmd.getDnsSearchOrder();
Long userId = UserContext.current().getCallerUserId();
int startVnetRange = 0;
int stopVnetRange = 0;
@ -1186,15 +1186,15 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
}
// add the domain prefix list to details if not null
if (domainSuffixList != null){
for(String dom : domainSuffixList){
if (dnsSearchOrder != null){
for(String dom : dnsSearchOrder){
if (!NetUtils.verifyDomainName(dom)) {
throw new InvalidParameterValueException(
"Invalid network domain suffixes. Total length shouldn't exceed 190 chars. Each domain label must be between 1 and 63 characters long, can contain ASCII letters 'a' through 'z', the digits '0' through '9', "
+ "and the hyphen ('-'); can't start or end with \"-\"");
}
}
newDetails.put("dns.suffixes", StringUtils.join(domainSuffixList, ","));
newDetails.put(ZoneConfig.DnsSearchOrder.getName(), StringUtils.join(dnsSearchOrder, ","));
}
if (userId == null) {

View File

@ -28,7 +28,8 @@ public enum ZoneConfig {
MaxVirtualMachines( Long.class, "max.vms", null, "Maximum number of VMs the Zone can have", null),
ZoneMode( String.class, "zone.mode", null, "Mode of the Zone", "Free,Basic,Advanced"),
HasNoPublicIp(Boolean.class, "has.no.public.ip", "false", "True if Zone has no public IP", null),
DhcpStrategy(String.class, "zone.dhcp.strategy", "cloudstack-systemvm", "Who controls DHCP", "cloudstack-systemvm,cloudstack-external,external");
DhcpStrategy(String.class, "zone.dhcp.strategy", "cloudstack-systemvm", "Who controls DHCP", "cloudstack-systemvm,cloudstack-external,external"),
DnsSearchOrder(String.class, "network.guestnetwork.dns.search.order", null, "Domains list to be used for domain search order", null);
private final Class<?> _type;

View File

@ -67,6 +67,7 @@ import com.cloud.capacity.dao.CapacityDao;
import com.cloud.cluster.ManagementServerNode;
import com.cloud.configuration.Config;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.configuration.ZoneConfig;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.configuration.dao.ResourceLimitDao;
import com.cloud.dc.DataCenter;
@ -1226,9 +1227,9 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
if (domain != null) {
buf.append(" domain=" + domain);
}
String domain_suffix = dcVO.getDetail("dns.suffixes");
String domain_suffix = dcVO.getDetail(ZoneConfig.DnsSearchOrder.getName());
if (domain_suffix != null) {
buf.append(" domainsuffix=").append(domain_suffix);
buf.append(" dnssearchorder=").append(domain_suffix);
}