From bd1e2fd60ff6c694b9daf2373b3f508b6274e15f Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Wed, 6 Sep 2017 15:12:45 -0400 Subject: [PATCH] Fix test_rpc_consumer_isolation for oslo.messaging 5.31.0 With this change in oslo.messaging 5.31.0: I0bbf9fca0ecbe71efa87c9613ffd32eb718f2c0e The endpoint passed in is going to be checked for a 'target' attribute and check it's type if set, so looking for it has to be ignored. Change-Id: Ic022bdc0291ce1498abdfe1acd3cc51adf7db7c6 Closes-Bug: #1715470 --- cinder/tests/unit/test_test.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cinder/tests/unit/test_test.py b/cinder/tests/unit/test_test.py index b59244c1ac8..659f8e156e4 100644 --- a/cinder/tests/unit/test_test.py +++ b/cinder/tests/unit/test_test.py @@ -38,8 +38,13 @@ class IsolationTestCase(test.TestCase): def test_rpc_consumer_isolation(self): class NeverCalled(object): - def __getattribute__(*args): - self.fail(msg="I should never get called.") + def __getattribute__(self, name): + if name == 'target': + # oslo.messaging 5.31.0 explicitly looks for 'target' + # on the endpoint and checks it's type, so we can't avoid + # it here, just ignore it if that's the case. + return + self.fail(msg="I should never get called. name: %s" % name) server = rpc.get_server(messaging.Target(topic='volume', server=cfg.CONF.host),