mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 17:23:09 +00:00
Don't use netconf's discard_changes when the device has no candidate cap (#19626)
The discard_changes netconf RPC requires the candidate capability. We were getting an exception when configuring that kind of device. Fixes #19529
This commit is contained in:
committed by
Peter Sprygada
parent
c58278b1c2
commit
0296f70f07
@@ -136,7 +136,8 @@ def netconf_edit_config(m, xml, commit, retkwargs):
|
||||
datastore = 'running'
|
||||
m.lock(target=datastore)
|
||||
try:
|
||||
m.discard_changes()
|
||||
if ":candidate" in m.server_capabilities:
|
||||
m.discard_changes()
|
||||
config_before = m.get_config(source=datastore)
|
||||
m.edit_config(target=datastore, config=xml)
|
||||
config_after = m.get_config(source=datastore)
|
||||
|
||||
Reference in New Issue
Block a user