Support for HostAddress opt
Since Oslo has introduced the new opt HostAddress opt[1].
This would ensure that an invalid IP does not pass as
a valid hostname and at the same time retains the
rules required to be followed for the validation of
an acceptable hostname.
[1]:https://review.openstack.org/#/c/358045/
@@ -45,7 +45,7 @@ core_opts = [
CONF.register_cli_opts(core_opts)
global_opts = [
- cfg.StrOpt('my_ip',
+ cfg.HostAddressOpt('my_ip',
default=netutils.get_my_ipv4(),
help='IP address of this host'),
cfg.ListOpt('glance_api_servers',
@@ -113,10 +113,11 @@ global_opts = [
cfg.StrOpt('scheduler_manager',
default='cinder.scheduler.manager.SchedulerManager',
help='Full class name for the Manager for scheduler'),
- cfg.StrOpt('host',
+ cfg.HostAddressOpt('host',
default=socket.gethostname(),
- help='Name of this node. This can be an opaque identifier. '
- 'It is not necessarily a host name, FQDN, or IP address.'),
+ help='Name of this node. This can be an opaque '
+ 'identifier. It is not necessarily a host name, '
+ 'FQDN, or IP address.'),
# NOTE(vish): default to nova for compatibility with nova installs
cfg.StrOpt('storage_availability_zone',
default='nova',
