Merge "Use hostname to avoid clash with section"

This commit is contained in:
Zuul 2020-03-31 08:02:26 +00:00 committed by Gerrit Code Review
commit 5f712ad968
4 changed files with 16 additions and 4 deletions

View File

@ -17,8 +17,9 @@ import socket
from oslo_config import cfg
service_opts = [
cfg.StrOpt('host',
cfg.StrOpt('hostname',
default=socket.gethostname(),
deprecated_name="host",
help='''
Hostname, FQDN or IP address of this host. Must be valid within AMQP key.

View File

@ -55,7 +55,7 @@ class Manager(PeriodicTasks):
def __init__(self, host=None, service_name='undefined'):
if not host:
host = CONF.host
host = CONF.hostname
self.host = host
self.service_name = service_name
super(Manager, self).__init__()

View File

@ -69,13 +69,13 @@ class Service(service.Service):
def create(cls, host=None, binary=None, manager=None):
"""Instantiates class and passes back application object.
:param host: defaults to CONF.host
:param host: defaults to CONF.hostname
:param binary: defaults to basename of executable
:param manager: defaults to CONF.<Latter part of binary>_manager
"""
if not host:
host = CONF.host
host = CONF.hostname
if not binary:
binary = os.path.basename(sys.argv[0])

View File

@ -0,0 +1,11 @@
---
features:
- |
A 'hostname' option has been added to the Masakari monitors configuration
file which replaces the 'host' option. The option should be used to specify
the Hostname, FQDN or IP address of the host.
deprecations:
- |
The 'host' option in the 'DEFAULT' section has been deprecated as it
clashes with the name of a section in the same file. It has been replaced
by the 'hostname' option.