-
For NXOS, if you call `device.load_merge_candidate(filename='merge.txt') more than once, you'll get a duplicate set of commands from merge.txt. Example merge.txt:
>>> device.load_merge_candidate(filename='merge.txt')
>>> device.load_merge_candidate(filename='merge.txt')
>>> print(device.merge_candidate)
!
hostname test
!
!
hostname test
!
>>> Seems like at least for the filename arg, calling |
Beta Was this translation helpful? Give feedback.
Answered by
ktbyers
Aug 30, 2023
Replies: 1 comment 2 replies
-
What happens if you try to load two different merge files (that have different changes)?
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The user didn't say to
discard_config()
on the pending change (to discard the pending candidate config), nor did you saycommit_config()
(to commit the initial candidate config), I am inclined to say that is the right behavior (though definitely open to arguments).In other words, if you load a bunch of incremental merge changes one after the other they should all just go into the candidate config.
In the case of Cisco IOS and NX-OS (since the candidate config is not real) this can result in some strange things like duplicate configs, but the router will resolve those when the config is loaded. Also issues would potentially show up in the
compare_config
(though this compare_config on merg…