mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
adding support for no candidate config (#20821)
commit fails for devices with no candidate config, such as when configuraion is written to running-config store. Commit is set to True in main's call of netconf_edit_config. The simple edit is to add the additional logic around sending the commit. Otherwise you could change commit could be set to (if ":candidate" in m.server_capabilities) in the call of netconf_edit_config. Either way would work. I'll defer for the decision of which.
This commit is contained in:
parent
b7e78656ac
commit
534dbb094b
1 changed files with 1 additions and 1 deletions
|
@ -142,7 +142,7 @@ def netconf_edit_config(m, xml, commit, retkwargs):
|
|||
m.edit_config(target=datastore, config=xml)
|
||||
config_after = m.get_config(source=datastore)
|
||||
changed = config_before.data_xml != config_after.data_xml
|
||||
if changed and commit:
|
||||
if changed and commit and ":candidate" in m.server_capabilities:
|
||||
if ":confirmed-commit" in m.server_capabilities:
|
||||
m.commit(confirmed=True)
|
||||
m.commit()
|
||||
|
|
Loading…
Reference in a new issue