This repository has been archived by the owner on Mar 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Allow multiple changes over the same session #134
Merged
mirceaulinic
merged 2 commits into
napalm-automation:develop
from
mirceaulinic:ld_merge_sess
Feb 8, 2017
Merged
Allow multiple changes over the same session #134
mirceaulinic
merged 2 commits into
napalm-automation:develop
from
mirceaulinic:ld_merge_sess
Feb 8, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ping @bewing - can you test this branch and cross-check that it works as expected? |
Before: >>> i.open()
>>> i.load_merge_candidate(config='ntp server 1.2.3.4')
>>> i.load_merge_candidate(config='ntp server 5.6.7.8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "napalm_eos/eos.py", line 170, in load_merge_candidate
self._load_config(filename, config, False)
File "napalm_eos/eos.py", line 127, in _load_config
raise SessionLockedException('Session is already in use by napalm')
napalm_base.exceptions.SessionLockedException: Session is already in use by napalm
>>> Which is not consistent with other drivers (not sure about IOS). After: >>> i.open()
>>> i.load_merge_candidate(config='ntp server 1.2.3.4')
>>> i.load_merge_candidate(config='ntp server 5.6.7.8')
>>> print i.compare_config()
@@ -41,6 +41,8 @@
ip name-server vrf default 8.8.8.8
!
ntp source Loopback0
+ntp server 1.2.3.4
+ntp server 5.6.7.8 |
1ce1cea prevents applying parallel changes within the same configuration session. |
Can confirm that this resolves saltstack/salt#39149 root@saltmaster:/srv/salt# salt veos1 state.sls router.ntp
veos1:
----------
ID: cf_ntp
Function: netntp.managed
Result: True
Comment:
Started: 06:42:24.061354
Duration: 5563.203 ms
Changes:
----------
servers:
----------
added:
- 192.168.0.1
removed:
- 10.194.2.17
Summary for veos1
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 5.563 s |
Thanks for confirmation @bewing! Anyway, the scope is not to solve that particular case, but more to assure consistency across napalm drivers. |
Nice! |
dbarrosop
approved these changes
Feb 5, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #133