Skip to content

Commit

Permalink
chore: linter update, update textfsmparse singature to match scrapli …
Browse files Browse the repository at this point in the history
…core update
  • Loading branch information
carlmontanari committed Jan 7, 2025
1 parent ffe37ac commit 1e84e0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scrapli_netconf/driver/async_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AsyncNetconfDriver(AsyncDriver, NetconfBaseDriver):
# type `NetconfChannel`
channel: AsyncNetconfChannel

def __init__(
def __init__( # pylint: disable=R0917
self,
host: str,
port: int = 830,
Expand Down
2 changes: 1 addition & 1 deletion scrapli_netconf/driver/sync_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NetconfDriver(Driver, NetconfBaseDriver):
# type `NetconfChannel`
channel: NetconfChannel

def __init__(
def __init__( # pylint: disable=R0917
self,
host: str,
port: int = 830,
Expand Down
6 changes: 5 additions & 1 deletion scrapli_netconf/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ def get_xml_elements(self) -> Dict[str, Element]:
return xml_elements

def textfsm_parse_output(
self, template: Union[str, TextIO, None] = None, to_dict: bool = True
self,
template: Union[str, TextIO, None] = None,
to_dict: bool = True,
raise_err: bool = False,
) -> Union[Dict[str, Any], List[Any]]:
"""
Parse results with textfsm, always return structured data
Expand All @@ -305,6 +308,7 @@ def textfsm_parse_output(
template: string path to textfsm template or opened textfsm template file
to_dict: convert textfsm output from list of lists to list of dicts -- basically create
dict from header and row data so it is easier to read/parse the output
raise_err: exceptions in the textfsm parser will be raised for the caller to handle
Returns:
structured_result: empty list or parsed data from textfsm
Expand Down

0 comments on commit 1e84e0f

Please sign in to comment.