Fix test_rpc_consumer_isolation for oslo.messaging 5.31.0
With this change in oslo.messaging 5.31.0:
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.
Closes-Bug:
@@ -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),
