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
Member

@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

@rallytime rallytime commented Jul 26, 2018

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/

@mirceaulinic mirceaulinic force-pushed the napalm-commit-schedule branch from 11620cb to 9538445 Jul 31, 2018
Copy link
Contributor

@rallytime rallytime left a comment

This looks good to me, pending tests.

Copy link
Contributor

@gtmanfred gtmanfred left a comment

this looks awesome!

@rallytime
Copy link
Contributor

@rallytime rallytime commented Aug 1, 2018

@mirceaulinic mirceaulinic force-pushed the napalm-commit-schedule branch from 9538445 to 74a0b9b Aug 2, 2018
@mirceaulinic
Copy link
Member Author

@mirceaulinic mirceaulinic commented Aug 2, 2018

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

@rallytime
Copy link
Contributor

@rallytime rallytime commented Aug 2, 2018

Looks good now! Thanks @mirceaulinic!

@rallytime rallytime merged commit 5678a2c into saltstack:develop Aug 2, 2018
5 of 9 checks passed
@mirceaulinic mirceaulinic deleted the napalm-commit-schedule branch Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants