1
0
Fork 0
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:
Kevin Kuhls 2017-02-08 08:58:23 -05:00 committed by Peter Sprygada
parent b7e78656ac
commit 534dbb094b

View file

@ -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()