mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Fix netconf module and plugin issues (#45140)
* Fix netconf netconf issues * Identifier is optional for get_schema api * Fix dispatch api mandatory argument check * Add save option handling to copy config from target datastore to startup datastore if supported * Validate config in check-mode or if validate option set to true * Copy config if check-mode is not enabled
This commit is contained in:
parent
177fbea351
commit
455dfbe732
2 changed files with 12 additions and 11 deletions
|
@ -204,7 +204,7 @@ class NetconfBase(AnsiblePlugin):
|
|||
:param filter: specifies the portion of the configuration to retrieve (by default entire configuration is retrieved)
|
||||
:return: Returns xml string containing the RPC response received from remote host
|
||||
"""
|
||||
if rpc_command:
|
||||
if rpc_command is None:
|
||||
raise ValueError('rpc_command value must be provided')
|
||||
req = fromstring(rpc_command)
|
||||
resp = self.m.dispatch(req, source=source, filter=filter)
|
||||
|
@ -270,8 +270,6 @@ class NetconfBase(AnsiblePlugin):
|
|||
:param format: format of the schema to be retrieved, yang is the default
|
||||
:return: Returns xml string containing the RPC response received from remote host
|
||||
"""
|
||||
if identifier:
|
||||
raise ValueError('identifier value must be provided')
|
||||
resp = self.m.get_schema(identifier, version=version, format=format)
|
||||
return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue