exposes rpc method to plugin (#35507)

The rpc method should be exposed to the modules over the connection rpc
mechanism.  This fix will expose the rpc method to call generalized rpc
endpoints on remote devices
This commit is contained in:
Peter Sprygada 2018-01-30 12:27:48 -05:00 committed by GitHub
parent bf5770dec4
commit 58d54799b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -63,11 +63,7 @@ class Netconf(NetconfBase):
def execute_rpc(self, name):
"""RPC to be execute on remote device
:name: Name of rpc in string format"""
try:
obj = to_ele(to_bytes(name, errors='surrogate_or_strict'))
return self.m.rpc(obj).data_xml
except RPCError as exc:
raise Exception(to_xml(exc.xml))
return self.rpc(name)
@ensure_connected
def load_configuration(self, *args, **kwargs):