mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
New ansible module netconf_rpc (#40358)
* New ansible module netconf_rpc * add integration test for module netconf_rpc * pep8/meta-data corrections * usage of jxmlease for all XML processing separation of attributes "rpc" and "content" * removed unused imports improved error handling * fixed pep8 * usage of ast.literal_eval instead of eval added description to SROS integration test for cases commented out
This commit is contained in:
parent
ea4a78b2a1
commit
387a23c3d1
13 changed files with 561 additions and 19 deletions
|
@ -48,13 +48,13 @@ def get_capabilities(module):
|
|||
return module._netconf_capabilities
|
||||
|
||||
|
||||
def lock_configuration(x, target=None):
|
||||
conn = get_connection(x)
|
||||
def lock_configuration(module, target=None):
|
||||
conn = get_connection(module)
|
||||
return conn.lock(target=target)
|
||||
|
||||
|
||||
def unlock_configuration(x, target=None):
|
||||
conn = get_connection(x)
|
||||
def unlock_configuration(module, target=None):
|
||||
conn = get_connection(module)
|
||||
return conn.unlock(target=target)
|
||||
|
||||
|
||||
|
@ -104,3 +104,13 @@ def get(module, filter, lock=False):
|
|||
conn.unlock(target='running')
|
||||
|
||||
return response
|
||||
|
||||
|
||||
def dispatch(module, request):
|
||||
conn = get_connection(module)
|
||||
try:
|
||||
response = conn.dispatch(request)
|
||||
except ConnectionError as e:
|
||||
module.fail_json(msg=to_text(e, errors='surrogate_then_replace').strip())
|
||||
|
||||
return response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue