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

Projects
None yet
3 participants
@mirceaulinic
Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

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 mirceaulinic:napalm-commit-schedule branch from 11620cb to 9538445 Jul 31, 2018

@rallytime
Copy link
Contributor

left a comment

This looks good to me, pending tests.

@rallytime rallytime requested a review from gtmanfred Jul 31, 2018

@rallytime rallytime added the Fluorine label Jul 31, 2018

@gtmanfred
Copy link
Contributor

left a comment

this looks awesome!

@rallytime

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2018

@mirceaulinic mirceaulinic force-pushed the mirceaulinic:napalm-commit-schedule branch from 9538445 to 74a0b9b Aug 2, 2018

@mirceaulinic

This comment has been minimized.

Copy link
Member Author

commented Aug 2, 2018

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

@rallytime

This comment has been minimized.

Copy link
Contributor

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

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
codeclimate 6 issues to fix
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has failed
Details
jenkins/pr/py2-centos-7 running py2-centos-7...
Details
WIP ready for review
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details

@mirceaulinic mirceaulinic deleted the mirceaulinic: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
You can’t perform that action at this time.