Browse Source

Use hostname to avoid clash with section

Switch to using 'hostname' rather than 'host' to specify the
Hostname, FQDN or IP address of this host. This is to avoid a
clash with a section of the same name *1

*1 https://github.com/openstack/masakari-monitors/blob/master/masakarimonitors/conf/host.py#L87

Change-Id: I7d95b063c2eabbd8893857b5e1e7d342db0aebec
Closes-Bug: #1866660
tags/9.0.0.0rc1
Liam Young 4 months ago
parent
commit
8cb4de9e65
4 changed files with 16 additions and 4 deletions
  1. +2
    -1
      masakarimonitors/conf/service.py
  2. +1
    -1
      masakarimonitors/manager.py
  3. +2
    -2
      masakarimonitors/service.py
  4. +11
    -0
      releasenotes/notes/bug-1866660-ef8624f5283b2e5e.yaml

+ 2
- 1
masakarimonitors/conf/service.py 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.



+ 1
- 1
masakarimonitors/manager.py 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__()


+ 2
- 2
masakarimonitors/service.py 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])



+ 11
- 0
releasenotes/notes/bug-1866660-ef8624f5283b2e5e.yaml 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.

Loading…
Cancel
Save