Add napalm commit confirmed features #48909
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
In line with my previous PR #48779, adding now two new features
revert_inandrevert_atthat would schedule a configuration revert, similar to what we have on Junos (where is called "commit confirmed"). I opted to use these names as I find it makes it more obvious that the configuration will be reverted unless instructed otherwise.The main problem is not the naming nevertheless, but the fact that not all the platforms support this natively (only Junos AFAIK). However, via Salt this would be available on any platform, but with some caveats and the user must be very cautious when using this (not that the feature itself can cause issues, but to have the right expectations when using this).
Usage example:
With this PR, I am also:
commit_confirmedandcommit_cancelledState functions to thenetconfigState.commit_idkey which can be used using the__slots__feature to be sent to the state functions mentioned above.