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: I2463fc873bb149cafa802f5743d5f482f25552fc
This commit is contained in:
blue55 2017-03-17 16:33:38 +08:00
parent 63122e8b4d
commit 3b450c65dd
4 changed files with 15 additions and 14 deletions

View File

@ -32,10 +32,10 @@ from ceilometer.publisher import utils as publisher_utils
from ceilometer import utils
OPTS = [
cfg.StrOpt('udp_address',
default='0.0.0.0',
help='Address to which the UDP socket is bound. Set to '
'an empty string to disable.'),
cfg.HostAddressOpt('udp_address',
default='0.0.0.0',
help='Address to which the UDP socket is bound. Set to '
'an empty string to disable.'),
cfg.PortOpt('udp_port',
default=4952,
help='Port to which the UDP socket is bound.'),

View File

@ -29,9 +29,9 @@ opt_group = cfg.OptGroup(name='vmware',
title='Options for VMware')
OPTS = [
cfg.StrOpt('host_ip',
default='',
help='IP address of the VMware vSphere host.'),
cfg.HostAddressOpt('host_ip',
default='127.0.0.1',
help='IP address of the VMware vSphere host.'),
cfg.PortOpt('host_port',
default=443,
help='Port of the VMware vSphere host.'),

View File

@ -57,12 +57,13 @@ import ceilometer.volume.discovery
OPTS = [
cfg.StrOpt('host',
default=socket.gethostname(),
sample_default='<your_hostname>',
help='Name of this node, which must be valid in an AMQP '
'key. Can be an opaque identifier. For ZeroMQ only, must '
'be a valid host name, FQDN, or IP address.'),
cfg.HostAddressOpt('host',
default=socket.gethostname(),
sample_default='<your_hostname>',
help='Name of this node, which must be valid in an '
'AMQP key. Can be an opaque identifier. For ZeroMQ '
'only, must be a valid host name, FQDN, or IP '
'address.'),
cfg.IntOpt('http_timeout',
default=600,
help='Timeout seconds for HTTP requests. Set it to None to '

View File

@ -15,7 +15,7 @@ keystonemiddleware!=4.1.0,>=4.0.0 # Apache-2.0
lxml>=2.3 # BSD
msgpack-python>=0.4.0 # Apache-2.0
oslo.concurrency>=3.5.0 # Apache-2.0
oslo.config>=3.9.0 # Apache-2.0
oslo.config>=3.22.0 # Apache-2.0
oslo.db>=4.1.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0
oslo.log>=1.14.0 # Apache-2.0