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:
parent
c58278b1c2
commit
0296f70f07
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue