bug 10812: putting key in ZoneConfig and other nomenclature changes

This commit is contained in:
Abhinandan Prateek 2011-08-03 14:16:08 +05:30 committed by root
parent 66d07c5d27
commit f6303c13fb
7 changed files with 18 additions and 18 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,8 +1186,8 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
}
// add the domain prefix list to details if not null
if (domainSuffixList != null){
newDetails.put("dns.suffixes", StringUtils.join(domainSuffixList, ","));
if (dnsSearchOrder != null){
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;
@ -1232,9 +1233,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);
}