raise attribute error for non-rpc functions in Contact

This commit is contained in:
Jack Robison 2018-05-29 10:59:07 -04:00
parent ec1b6b2387
commit 0d23c68797
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -139,6 +139,9 @@ class _Contact(object):
host Node's C{_protocol} object). host Node's C{_protocol} object).
""" """
if name not in ['ping', 'findValue', 'findNode', 'store']:
raise AttributeError("unknown command: %s" % name)
def _sendRPC(*args, **kwargs): def _sendRPC(*args, **kwargs):
return self._networkProtocol.sendRPC(self, name, args, **kwargs) return self._networkProtocol.sendRPC(self, name, args, **kwargs)