Browse Source

Fix error in example of an RPC server

Sample code in the documentation for rpc.server has an error which
prevents the code from being run. Replacing the `self` with `None`
results in code that runs. Whether it does anything useful is
an open question.

Change-Id: I81391fa3efdc65d54ca3aa155d63584f2b6f98c2
changes/10/108410/5
Chris Dent 7 years ago
parent
commit
ba5b547652
  1. 5
      oslo/messaging/rpc/server.py

5
oslo/messaging/rpc/server.py

@ -54,7 +54,8 @@ A simple example of an RPC server with multiple endpoints might be::
self.server = server
def stop(self, ctx):
self.server.stop()
if server:
self.server.stop()
class TestEndpoint(object):
@ -64,7 +65,7 @@ A simple example of an RPC server with multiple endpoints might be::
transport = messaging.get_transport(cfg.CONF)
target = messaging.Target(topic='test', server='server1')
endpoints = [
ServerControlEndpoint(self),
ServerControlEndpoint(None),
TestEndpoint(),
]
server = messaging.get_rpc_server(transport, target, endpoints,

Loading…
Cancel
Save