-
Notifications
You must be signed in to change notification settings - Fork 558
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
Unable to load banner MOTD on Arista #732
Comments
It appears that there's the same behaviour on a real device running |
…ced this issue before which makes me questions what changed when (and why)? Without this patch, loading a multiline banner motd fails (at least with the configuration I tried to load): ```python >>> config = '''banner motd ... !!aaaa ... EOF ... ''' >>> e.load_merge_candidate(config=config) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/napalm/eos/eos.py", line 245, in load_merge_candidate self._load_config(filename, config, False) File "/usr/local/lib/python2.7/dist-packages/napalm/eos/eos.py", line 225, in _load_config commands = self._multiline_convert(commands, start=start, depth=depth) File "/usr/local/lib/python2.7/dist-packages/napalm/eos/eos.py", line 157, in _multiline_convert ret[s] = {'cmd': ret[s], 'input': "\n".join(ret[s+1:e])} TypeError: sequence item 0: expected string or Unicode, dict found ```
Per slack discussion, I believe this is occurring because The former reformats block-mode comments (which appear in configs as multi-line comments, all starting with If we re-order these two operations (so the banner is converted, and then we check for mode-level comments), it should work as intended, I hope. |
Confirmed that the issue was caused only by the |
@mirceaulinic can you checkout PR #738 and see if that resolves your issue? |
The new heredoc handling code was causing issues with multiline banners that contained bangs (!), as we originally checked first for bang comments before checking for heredoc sections. * Fixes napalm-automation#732
The new heredoc handling code was causing issues with multiline banners that contained bangs (!), as we originally checked first for bang comments before checking for heredoc sections. * Fixes napalm-automation#732
Firstly, I am not entirely sure what's the right format expected. I tried loading:
With this, it fails:
Testing against a vEOS running:
Changing the line 157 to:
As it looks like
ret
is a list looking like:[u'configure session napalm_61252', 'banner motd', {u'input': u'aaaa', u'cmd': u'comment'}, 'EOF']
, and the object referenced byret[s+1:e]
is a list of dictionaries (not a list of strings).@bewing I recall you've been working on this, would you recall any details and wondering if on other EOS versions pyeapi returns a list of strings as the code would suggest? I am running pyeapi
0.8.1
.The text was updated successfully, but these errors were encountered: