Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two new features for the napalm configuration management: commit_in and commit_at #48779

Merged
merged 4 commits into from
Aug 2, 2018

Conversation

mirceaulinic
Copy link
Contributor

@mirceaulinic mirceaulinic commented Jul 26, 2018

What does this PR do?

In the networking world, there are a very small number of platforms that allow you to commit a specific configuration change at a desired time. Although this is not particularly one of the best practices, turns out to be important sometimes (very rarely though). Nevertheless it is and will forever be optional.

With these changes, I am adding support for commit_in and commit_at to commit the config changes later. This simply leverages the abilities of the Salt scheduler, by adding a job to be executed once, at the time requested by the user. Therefore, this is available for any network platform managed through NAPALM, regardless if they do or don't support scheduled commit capabilities.

For safety reasons, I am adding the net.cancel_commit counterpart execution function to discard a scheduled commit.

Example:

# salt veos net.load_config text='ntp server 4.3.2.1' commit_in=2m
veos:
    ----------
    already_configured:
        False
    comment:
        Changes discarded for now, and scheduled commit at: 2018-07-26T10:06:33.
        The commit ID is: 20180726100429648495.
        To discard this commit, you can execute:

        salt veos net.cancel_commit 20180726100429648495
    diff:
        @@ -5,6 +5,7 @@
         transceiver qsfp default-mode 4x10G
         !
         ntp server 1.2.3.4
        +ntp server 4.3.2.1
         ntp server 5.6.7.8
         ntp server 10.10.10.1
         !
    loaded_config:
    result:
        True

@mirceaulinic mirceaulinic changed the title Two new feature for the napalm configuration management: commit_in and commit_at Two new features for the napalm configuration management: commit_in and commit_at Jul 26, 2018
@rallytime
Copy link
Contributor

Hi @mirceaulinic - this is causing some related tests to fail. Can you take a look?

https://jenkinsci.saltstack.com/job/pr-kitchen-ubuntu1604-py2/job/PR-48779/1/

Copy link
Contributor

@rallytime rallytime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, pending tests.

@rallytime rallytime requested a review from gtmanfred July 31, 2018 20:38
@rallytime rallytime added the ZRELEASED - Fluorine reitred label label Jul 31, 2018
Copy link
Contributor

@gtmanfred gtmanfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks awesome!

@rallytime
Copy link
Contributor

@mirceaulinic There are 2 tests failing with this change:

https://jenkinsci.saltstack.com/job/pr-kitchen-ubuntu1604-py2/job/PR-48779/1/

@mirceaulinic
Copy link
Contributor Author

Hi @rallytime - I have corrected that error, please let me know if there's anything else. Thanks!

@rallytime
Copy link
Contributor

Looks good now! Thanks @mirceaulinic!

@rallytime rallytime merged commit 5678a2c into saltstack:develop Aug 2, 2018
@mirceaulinic mirceaulinic deleted the napalm-commit-schedule branch August 2, 2018 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants