Skip to content

Commit

Permalink
Use HostAddressOpt for opts that accept IP and hostnames
Browse files Browse the repository at this point in the history
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using ``StrOpt``. The change [1] that
added support for ``HostAddressOpt`` type was merged in Ocata
and became available for use with oslo version 3.22.

This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.

[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb

TrivialFix

Change-Id: I5a564efc189c062cc3a780aef1baf32b28914b39
  • Loading branch information
luqitao committed Apr 20, 2017
1 parent 0a90dc3 commit ac799dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions neutron/conf/agent/metadata/config.py
Expand Up @@ -44,9 +44,11 @@
cfg.StrOpt('auth_ca_cert',
help=_("Certificate Authority public key (CA cert) "
"file for ssl")),
cfg.StrOpt('nova_metadata_host', default='127.0.0.1',
deprecated_name='nova_metadata_ip',
help=_("IP address or DNS name of Nova metadata server.")),
cfg.HostAddressOpt('nova_metadata_host',
default='127.0.0.1',
deprecated_name='nova_metadata_ip',
help=_("IP address or DNS name of Nova metadata "
"server.")),
cfg.PortOpt('nova_metadata_port',
default=8775,
help=_("TCP Port used by Nova metadata server.")),
Expand Down
16 changes: 8 additions & 8 deletions neutron/conf/common.py
Expand Up @@ -22,8 +22,8 @@


core_opts = [
cfg.StrOpt('bind_host', default='0.0.0.0',
help=_("The host IP to bind to")),
cfg.HostAddressOpt('bind_host', default='0.0.0.0',
help=_("The host IP to bind to.")),
cfg.PortOpt('bind_port', default=9696,
help=_("The port to bind to")),
cfg.StrOpt('api_extensions_path', default="",
Expand Down Expand Up @@ -96,12 +96,12 @@
"Attention: the following parameter MUST be set to "
"False if Neutron is being used in conjunction with "
"Nova security groups.")),
cfg.StrOpt('host', default=net.get_hostname(),
sample_default='example.domain',
help=_("Hostname to be used by the Neutron server, agents and "
"services running on this machine. All the agents and "
"services running on this machine must use the same "
"host value.")),
cfg.HostAddressOpt('host', default=net.get_hostname(),
sample_default='example.domain',
help=_("Hostname to be used by the Neutron server, "
"agents and services running on this machine. "
"All the agents and services running on this "
"machine must use the same host value.")),
cfg.StrOpt("network_link_prefix",
help=_("This string is prepended to the normal URL that is "
"returned in links to the OpenStack Network API. If it "
Expand Down

0 comments on commit ac799dc

Please sign in to comment.