mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 22:30:22 -07:00
Update netconf_config module (#44379)
Fixes #40650 Fixes #40245 Fixes #41541 * Refactor netconf_config module as per proposal #104 * Update netconf_config module metadata to core network supported * Refactor local connection to use persistent connection framework for backward compatibility * Update netconf connection plugin configuration varaibles (Fixes #40245) * Add support for optional lock feature to Fixes #41541 * Add integration test for netconf_config module * Documentation update * Move deprecated options in netconf_config module
This commit is contained in:
parent
4632ae4b28
commit
ce541454e9
22 changed files with 805 additions and 268 deletions
|
@ -111,8 +111,6 @@ class NetconfBase(AnsiblePlugin):
|
|||
:param name: Name of rpc in string format
|
||||
:return: Received rpc response from remote host
|
||||
"""
|
||||
"""RPC to be execute on remote device
|
||||
:name: Name of rpc in string format"""
|
||||
try:
|
||||
obj = to_ele(name)
|
||||
resp = self.m.rpc(obj)
|
||||
|
@ -275,13 +273,19 @@ class NetconfBase(AnsiblePlugin):
|
|||
return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml
|
||||
|
||||
@ensure_connected
|
||||
def locked(self, target):
|
||||
def delete_config(self, target):
|
||||
"""
|
||||
Returns a context manager for a lock on a datastore
|
||||
:param target: Name of the configuration datastore to lock
|
||||
:return: Locked context object
|
||||
delete a configuration datastore
|
||||
:param target: specifies the name or URL of configuration datastore to delete
|
||||
:return: Returns xml string containing the RPC response received from remote host
|
||||
"""
|
||||
return self.m.locked(target)
|
||||
resp = self.m.delete_config(target)
|
||||
return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml
|
||||
|
||||
@ensure_connected
|
||||
def locked(self, *args, **kwargs):
|
||||
resp = self.m.locked(*args, **kwargs)
|
||||
return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml
|
||||
|
||||
@abstractmethod
|
||||
def get_capabilities(self):
|
||||
|
@ -341,6 +345,7 @@ class NetconfBase(AnsiblePlugin):
|
|||
operations['supports_startup'] = ':startup' in capabilities
|
||||
operations['supports_xpath'] = ':xpath' in capabilities
|
||||
operations['supports_writable_running'] = ':writable-running' in capabilities
|
||||
operations['supports_validate'] = ':writable-validate' in capabilities
|
||||
|
||||
operations['lock_datastore'] = []
|
||||
if operations['supports_writable_running']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue