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
This commit is contained in:
Matt Riedemann 2017-09-06 15:12:45 -04:00
parent 9b6d70b226
commit bd1e2fd60f
1 changed files with 7 additions and 2 deletions

View File

@ -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),