Skip to content

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/

@mirceaulinic mirceaulinic force-pushed the napalm-commit-schedule branch from 11620cb to 9538445 Compare July 31, 2018 16:59
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.

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 mirceaulinic force-pushed the napalm-commit-schedule branch from 9538445 to 74a0b9b Compare August 2, 2018 11:12
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants