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

PARSE: Update parse module to account for new and old TextFSM packaging #305

Merged
merged 1 commit into from
Nov 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ntc_templates/parse.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""ntc_templates.parse."""
import os
import sys
from textfsm.clitable import CliTableError
import textfsm.clitable as clitable
try:
from textfsm import clitable
except ImportError:
import clitable


def _get_template_dir():
Expand Down Expand Up @@ -36,7 +38,7 @@ def parse_output(platform=None, command=None, data=None):
try:
cli_table.ParseCmd(data, attrs)
structured_data = _clitable_to_dict(cli_table)
except CliTableError as e:
except clitable.CliTableError as e:
raise Exception('Unable to parse command "%s" on platform %s - %s' % (command, platform, str(e)))
# Invalid or Missing template
# module.fail_json(msg='parsing error', error=str(e))
Expand Down