Handle oslo.messaging ping endpoint

We have a test that attempts to emulate a messaging endpoint and fails
if anything other than the endpoint's target property is inspected. With
the addition of the ping endpoint in
I51cf67e060f240e6eb82260e70a057fe599f9063, this now blows up with the
latest oslo.messagin release.

To handle this situation, our fake class just needs to also check for
the oslo_rpc_server_ping attribute.

Change-Id: I6675b37afb7bfb2491e1de4ec9e4bd0b3b2a0369
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-09-03 17:04:17 -05:00
parent 37749045c0
commit a8080d56b7
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
1 changed files with 2 additions and 2 deletions

View File

@ -40,9 +40,9 @@ class IsolationTestCase(test.TestCase):
class NeverCalled(object):
def __getattribute__(self, name):
if name == 'target':
if name == 'target' or name == 'oslo_rpc_server_ping':
# oslo.messaging 5.31.0 explicitly looks for 'target'
# on the endpoint and checks it's type, so we can't avoid
# on the endpoint and checks its 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)