-
Notifications
You must be signed in to change notification settings - Fork 744
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
Remove "terminal" dependency #672
Remove "terminal" dependency #672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we set the version of TextFSM, then we should also remove the try/except block here:
ntc-templates/lib/ntc_templates/parse.py
Lines 4 to 7 in fb64024
try: | |
from textfsm import clitable | |
except ImportError: | |
import clitable |
You want me to make that edit in this PR also (the parse.py multiple import edit--for old/new textfsm)? |
That would be great. Thanks |
Sounds good. Will update. |
Thanks @ktbyers |
* Eliminate terminal dependency * Fix imports to use only textfsm >=1.1
* Eliminate terminal dependency * Fix imports to use only textfsm >=1.1
* Eliminate terminal dependency * Fix imports to use only textfsm >=1.1
There was a long-standing issue in TextFSM which caused textfsm to break on Windows. This was due to the TextFSM library importing the "fcntl" library (inside TextFSM's terminal.py module).
ntc-templates had a workaround for this problem where they installed a completely different
terminal
library.This worked in textfsm 0.4.1 as textfsm_0_4_1 would put all of its Python files directly into site-packages (literally ./site-packages/terminal.py). Consequently, the install of the other
terminal
module would overwrite theterminal.py
that came installed with textfsm.With this fix here:
https://github.com/google/textfsm/blob/v1.1.1/textfsm/terminal.py#L25-L29
And with the fact that textfsm is now installed as a proper package in site-packages (in other words
site-packages/textfsm/
and then the package files inside that directory).The installation of the other
terminal
package should now be useless.The relevance to me is that I am interested in making ntc-templates a direct Netmiko dependency, but I don't really like installing this separate terminal.py file (https://github.com/lepture/terminal) as that library is unmaintained (last commit in 2013)
Additionally, I have had interoperability issues with the ntc-templates fix to this problem in the paste. And now that it is obsolete, it would be good to get rid of it.
There is no code that is actually by in terminal.py by ntc-templates or Netmiko (in either the old or the new solution). The problem is entirely an import issue.