-
Notifications
You must be signed in to change notification settings - Fork 70
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
IndexError: string index out of range #286
Comments
I think this is choking on the banner section of the config. Adding this bit and invoking the debugger: def is_subsection_present( section, indent ):
try:
return any( [line[ indent ] == ' ' for line in section] )
except:
import pdb; pdb.set_trace() And printing the -> import pdb; pdb.set_trace()
(Pdb) locals()
{'section': [' WARNING', ' '], 'pdb': <module 'pdb' from '/opt/homebrew/Cellar/[email protected]/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py'>, '__return__': None, 'indent': 36} |
The configuration of the switch has the following. I have only included the first part and redacted the rest, but it's choking on the banner section.
|
Hi, @sc68cal, thanks for catching this! pyeapi unit test also has to be updated accordingly to catch this regression. Would you be able also to add it to your PR? |
sure! Do you have some tips for where things should go? Which fixture should I add the banner config to? Which unit test files should I update, etc etc? Thanks |
fix for issue #286 - traceback when banner section contains white-spaces lines
Fixed with #291 |
I am trying to use pyEAPI with an Arista switch, and it appears that the code is broken, since all the API calls (
vlans
,bgp
, etc) do not work...The text was updated successfully, but these errors were encountered: