Improve Config Validation

This commit improves configuration validation.

* URIOpt to validate URL strings.
* HostnameOpt to validate hostnames

Change-Id: I4a6edf1faafbd242ca652df9a1eacd941288774a
Closes-Bug: #1599034
This commit is contained in:
Masaki Matsushita 2016-07-06 15:33:44 +09:00
parent 6705207080
commit b5bd80f9ac
1 changed files with 11 additions and 11 deletions

View File

@ -53,34 +53,34 @@ common_opts = [
'configured usage_timeout.'),
cfg.StrOpt('os_region_name', default='RegionOne',
help='Region name of this node. Used when searching catalog.'),
cfg.StrOpt('nova_compute_url', help='URL without the tenant segment.'),
cfg.URIOpt('nova_compute_url', help='URL without the tenant segment.'),
cfg.StrOpt('nova_compute_service_type', default='compute',
help='Service type to use when searching catalog.'),
cfg.StrOpt('nova_compute_endpoint_type', default='publicURL',
help='Service endpoint type to use when searching catalog.'),
cfg.StrOpt('nova_client_version', default='2.12',
help="The version of the compute service client."),
cfg.StrOpt('neutron_url', help='URL without the tenant segment.'),
cfg.URIOpt('neutron_url', help='URL without the tenant segment.'),
cfg.StrOpt('neutron_service_type', default='network',
help='Service type to use when searching catalog.'),
cfg.StrOpt('neutron_endpoint_type', default='publicURL',
help='Service endpoint type to use when searching catalog.'),
cfg.StrOpt('cinder_url', help='URL without the tenant segment.'),
cfg.URIOpt('cinder_url', help='URL without the tenant segment.'),
cfg.StrOpt('cinder_service_type', default='volumev2',
help='Service type to use when searching catalog.'),
cfg.StrOpt('cinder_endpoint_type', default='publicURL',
help='Service endpoint type to use when searching catalog.'),
cfg.StrOpt('heat_url', help='URL without the tenant segment.'),
cfg.URIOpt('heat_url', help='URL without the tenant segment.'),
cfg.StrOpt('heat_service_type', default='orchestration',
help='Service type to use when searching catalog.'),
cfg.StrOpt('heat_endpoint_type', default='publicURL',
help='Service endpoint type to use when searching catalog.'),
cfg.StrOpt('swift_url', help='URL ending in AUTH_.'),
cfg.URIOpt('swift_url', help='URL ending in AUTH_.'),
cfg.StrOpt('swift_service_type', default='object-store',
help='Service type to use when searching catalog.'),
cfg.StrOpt('swift_endpoint_type', default='publicURL',
help='Service endpoint type to use when searching catalog.'),
cfg.StrOpt('trove_auth_url', default='http://0.0.0.0:5000/v2.0',
cfg.URIOpt('trove_auth_url', default='http://0.0.0.0:5000/v2.0',
help='Trove authentication URL.'),
cfg.IPOpt('host', default='0.0.0.0',
help='Host to listen for RPC messages.'),
@ -96,17 +96,17 @@ common_opts = [
cfg.StrOpt('dns_instance_entry_factory',
default='trove.dns.driver.DnsInstanceEntryFactory',
help='Factory for adding DNS entries.'),
cfg.StrOpt('dns_hostname', default="",
help='Hostname used for adding DNS entries.'),
cfg.HostnameOpt('dns_hostname', default="localhost",
help='Hostname used for adding DNS entries.'),
cfg.StrOpt('dns_account_id', default="",
help='Tenant ID for DNSaaS.'),
cfg.StrOpt('dns_endpoint_url', default="0.0.0.0",
cfg.URIOpt('dns_endpoint_url', default="http://0.0.0.0",
help='Endpoint URL for DNSaaS.'),
cfg.StrOpt('dns_service_type', default="",
help='Service Type for DNSaaS.'),
cfg.StrOpt('dns_region', default="",
help='Region name for DNSaaS.'),
cfg.StrOpt('dns_auth_url', default="",
cfg.URIOpt('dns_auth_url', default="http://0.0.0.0",
help='Authentication URL for DNSaaS.'),
cfg.StrOpt('dns_domain_name', default="",
help='Domain name used for adding DNS entries.'),
@ -114,7 +114,7 @@ common_opts = [
help='Username for DNSaaS.'),
cfg.StrOpt('dns_passkey', default="", secret=True,
help='Passkey for DNSaaS.'),
cfg.StrOpt('dns_management_base_url', default="",
cfg.URIOpt('dns_management_base_url', default="http://0.0.0.0",
help='Management URL for DNSaaS.'),
cfg.IntOpt('dns_ttl', default=300,
help='Time (in seconds) before a refresh of DNS information '