Change default for [notifications]/default_publisher_id to $host
The default used in code for CONF.notifications.default_publisher_id is CONF.host, which is a free-form StrOpt. In an upcoming change, the "my_ip" option is going to be changed from a StrOpt to an IPOpt, so we made the default value change for the default_publisher_id option before that. Change-Id: Ia85130f66bd5a60097e8967064559fd0962d06fd Closes-Bug: #1713150
This commit is contained in:
parent
a3bc1b067b
commit
27cd4dd70b
|
@ -65,7 +65,7 @@ API service.
|
||||||
|
|
||||||
cfg.StrOpt(
|
cfg.StrOpt(
|
||||||
'default_publisher_id',
|
'default_publisher_id',
|
||||||
default='$my_ip',
|
default='$host',
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
deprecated_for_removal=True,
|
deprecated_for_removal=True,
|
||||||
deprecated_since='17.0.0',
|
deprecated_since='17.0.0',
|
||||||
|
@ -81,12 +81,12 @@ notifications using different publisher, change this value accordingly.
|
||||||
|
|
||||||
Possible values:
|
Possible values:
|
||||||
|
|
||||||
* Defaults to the IPv4 address of this host, but it can be any valid
|
* Defaults to the current hostname of this host, but it can be any valid
|
||||||
oslo.messaging publisher_id
|
oslo.messaging publisher_id
|
||||||
|
|
||||||
Related options:
|
Related options:
|
||||||
|
|
||||||
* my_ip - IP address of this host
|
* host - Hostname, FQDN or IP address of this host.
|
||||||
"""),
|
"""),
|
||||||
cfg.StrOpt(
|
cfg.StrOpt(
|
||||||
'notification_format',
|
'notification_format',
|
||||||
|
|
|
@ -19,6 +19,7 @@ import copy
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
from oslo_config import cfg
|
||||||
from oslo_context import context as o_context
|
from oslo_context import context as o_context
|
||||||
from oslo_context import fixture as o_fixture
|
from oslo_context import fixture as o_fixture
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
@ -36,6 +37,8 @@ from nova.tests.unit import fake_network
|
||||||
from nova.tests.unit import fake_notifier
|
from nova.tests.unit import fake_notifier
|
||||||
from nova.tests import uuidsentinel as uuids
|
from nova.tests import uuidsentinel as uuids
|
||||||
|
|
||||||
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
class NotificationsTestCase(test.TestCase):
|
class NotificationsTestCase(test.TestCase):
|
||||||
|
|
||||||
|
@ -625,6 +628,7 @@ class NotificationsTestCase(test.TestCase):
|
||||||
self.assertEqual(n.event_type, func_name)
|
self.assertEqual(n.event_type, func_name)
|
||||||
self.assertEqual(n.context, ctxt)
|
self.assertEqual(n.context, ctxt)
|
||||||
self.assertTrue(self.decorated_function_called)
|
self.assertTrue(self.decorated_function_called)
|
||||||
|
self.assertEqual(CONF.host, n.publisher_id)
|
||||||
|
|
||||||
|
|
||||||
class NotificationsFormatTestCase(test.NoDBTestCase):
|
class NotificationsFormatTestCase(test.NoDBTestCase):
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The ``[notifications]/default_publisher_id`` configuration option now
|
||||||
|
defaults to ``[DEFAULT]/host`` rather than ``[DEFAULT]/my_ip``.
|
Loading…
Reference in New Issue