mirror of https://github.com/apache/cloudstack.git
Validate network domain in upateNetwork command
This commit is contained in:
parent
bb5eaf2f02
commit
d1bee20b4a
|
|
@ -2893,6 +2893,14 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
|
||||
//don't allow to modify network domain if the service is not supported
|
||||
if (domainSuffix != null) {
|
||||
// validate network domain
|
||||
if (!NetUtils.verifyDomainName(domainSuffix)) {
|
||||
throw new InvalidParameterValueException(
|
||||
"Invalid network domain. 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 \"-\"");
|
||||
}
|
||||
|
||||
|
||||
Map<Network.Capability, String> dnsCapabilities = getServiceCapabilities(network.getDataCenterId(), network.getNetworkOfferingId(), Service.Dns);
|
||||
String isUpdateDnsSupported = dnsCapabilities.get(Capability.AllowDnsSuffixModification);
|
||||
if (isUpdateDnsSupported == null || !Boolean.valueOf(isUpdateDnsSupported)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue