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``. Now the support is
added for ``HostAddressOpt`` type and became available for
use with osloversion 3.22.

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

Change-Id: Id007b22bb0c43c8a0b4a4e3b9a4da6cc866f0563
This commit is contained in:
poojajadhav 2017-03-14 15:51:25 +05:30
parent a9e77d5404
commit 6ad7c90a1b
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ import socket
from oslo_config import cfg
service_opts = [
cfg.StrOpt('host',
cfg.HostAddressOpt('host',
default=socket.gethostname(),
help='''
Hostname, FQDN or IP address of this host. Must be valid within AMQP key.
@ -48,7 +48,7 @@ Possible values:
cfg.BoolOpt('use_ssl',
default=False,
help='Use APIs with SSL enabled'),
cfg.StrOpt('masakari_api_listen',
cfg.HostAddressOpt('masakari_api_listen',
default="0.0.0.0",
help='The IP address on which the Masakari API will listen.'),
cfg.IntOpt('masakari_api_listen_port',

View File

@ -8,7 +8,7 @@ jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
keystoneauth1>=2.10.0 # Apache-2.0
keystonemiddleware!=4.5.0,>=4.2.0 # Apache-2.0
microversion-parse>=0.1.2 # Apache-2.0
oslo.config>=3.10.0 # Apache-2.0
oslo.config>=3.22.0 # Apache-2.0
oslo.db>=4.1.0 # Apache-2.0
oslo.messaging>=5.11.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0