From 54fcea25407d6958cfd189f19e0e3c1ed12df91c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 20 Jun 2013 16:05:40 +0200 Subject: notifier: do not rely on CONF.host There's nothing in Oslo declaring an 'host' configuration option, so relying on it isn't a good practice. Let's use the same default value as intended, but make it work in any case. Change-Id: I9c898647e68e35435d1a58f920b6e610f217e4e8 Signed-off-by: Julien Danjou --- tests/unit/test_notifier.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/unit/test_notifier.py b/tests/unit/test_notifier.py index 6c3b886..891b0ec 100644 --- a/tests/unit/test_notifier.py +++ b/tests/unit/test_notifier.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +import socket + from oslo.config import cfg from openstack.common import context @@ -308,3 +310,9 @@ class MultiNotifierTestCase(test_utils.BaseTestCase): notifier_api.WARN, dict(a=3)) self.assertEqual(self.notify_count, 1) + + def test_publisher_id(self): + self.assertEqual(notifier_api.publisher_id('foobar'), + 'foobar.' + socket.gethostname()) + self.assertEqual(notifier_api.publisher_id('foobar', 'baz'), + 'foobar.baz') -- cgit