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

#732: Unable to load banner MOTD on Arista #733

Closed
wants to merge 1 commit into from
Closed

Conversation

mirceaulinic
Copy link
Member

This PR attempts to fix #732, however I am surprised that nobody noticed 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):

>>> 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

…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
```
@mirceaulinic mirceaulinic added this to the DISCUSSION milestone May 21, 2018
@mirceaulinic mirceaulinic requested a review from bewing May 21, 2018 15:19
@coveralls
Copy link

Coverage Status

Coverage remained the same at ?% when pulling 8ca6707 on fix-732 into 38b0132 on develop.

@mirceaulinic
Copy link
Member Author

As discussed with @bewing in private, and as per #732 (comment), this is not the right fix (actually there's no fix, as my syntax was incorrect).

@mirceaulinic mirceaulinic deleted the fix-732 branch May 23, 2018 09:00
@mirceaulinic mirceaulinic added invalid and removed bug labels May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to load banner MOTD on Arista
2 participants