Use HostAddressOpt for opts that accept IP and hostnames

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

Change-Id: I06e8cff035ecfaa651e215d7b18de5abc3a273c3
This commit is contained in:
Dharini Chandrasekar 2017-03-01 18:49:48 +00:00
parent 867ae562c3
commit 61d6973077
3 changed files with 9 additions and 15 deletions

View File

@ -584,9 +584,9 @@ Related options:
* data_api
""")),
cfg.StrOpt('pydev_worker_debug_host',
sample_default='localhost',
help=_("""
cfg.HostAddressOpt('pydev_worker_debug_host',
sample_default='localhost',
help=_("""
Host address of the pydev server.
Provide a string value representing the hostname or IP of the

View File

@ -56,16 +56,9 @@ from glance.i18n import _, _LE, _LI, _LW
bind_opts = [
# NOTE(dharinic): Since ``bind_host`` accepts symbolic names
# mapped to IP address apart from IP addresses, we use
# ``StrOpt`` as against ``IPOpt`` for backward compatibility
# reasons. We do not use ``HostnameOpt`` as it would prevent the
# opt from accepting IPv6 addresses.
# TODO(dharinic): Change the Opt type upon resolution of
# bug-1619044
cfg.StrOpt('bind_host',
default='0.0.0.0',
help=_("""
cfg.HostAddressOpt('bind_host',
default='0.0.0.0',
help=_("""
IP address to bind the glance servers to.
Provide an IP address to bind the glance server to. The default

View File

@ -23,8 +23,9 @@ from glance.i18n import _
registry_addr_opts = [
cfg.StrOpt('registry_host', default='0.0.0.0',
help=_("""
cfg.HostAddressOpt('registry_host',
default='0.0.0.0',
help=_("""
Address the registry server is hosted on.
Possible values: