mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
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:
parent
bf5770dec4
commit
58d54799b8
2 changed files with 13 additions and 6 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue