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
This commit is contained in:
Chris Dent 2014-07-21 16:43:51 +01:00
parent 8691b2457c
commit ba5b547652
1 changed files with 3 additions and 2 deletions

View File

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