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:
Matt Riedemann 2017-08-25 17:13:48 -04:00
parent a3bc1b067b
commit 27cd4dd70b
3 changed files with 12 additions and 3 deletions

View File

@ -65,7 +65,7 @@ API service.
cfg.StrOpt(
'default_publisher_id',
default='$my_ip',
default='$host',
deprecated_group='DEFAULT',
deprecated_for_removal=True,
deprecated_since='17.0.0',
@ -81,12 +81,12 @@ notifications using different publisher, change this value accordingly.
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
Related options:
* my_ip - IP address of this host
* host - Hostname, FQDN or IP address of this host.
"""),
cfg.StrOpt(
'notification_format',

View File

@ -19,6 +19,7 @@ import copy
import datetime
import mock
from oslo_config import cfg
from oslo_context import context as o_context
from oslo_context import fixture as o_fixture
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 import uuidsentinel as uuids
CONF = cfg.CONF
class NotificationsTestCase(test.TestCase):
@ -625,6 +628,7 @@ class NotificationsTestCase(test.TestCase):
self.assertEqual(n.event_type, func_name)
self.assertEqual(n.context, ctxt)
self.assertTrue(self.decorated_function_called)
self.assertEqual(CONF.host, n.publisher_id)
class NotificationsFormatTestCase(test.NoDBTestCase):

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``[notifications]/default_publisher_id`` configuration option now
defaults to ``[DEFAULT]/host`` rather than ``[DEFAULT]/my_ip``.