diff options
author | John Estabrook <jestabro@vyos.io> | 2023-03-03 11:30:27 -0600 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-03-05 19:38:07 -0600 |
commit | 1e72e1c68a708518526b8e090f5d6482671cbd57 (patch) | |
tree | b1b040241ad157ba8cc165b42d47cf8d00fa5fc7 /src/op_mode/conntrack.py | |
parent | ae2db32a13d78c5014c7b770f2de28949a13a6c3 (diff) | |
download | vyos-1x-1e72e1c68a708518526b8e090f5d6482671cbd57.tar.gz vyos-1x-1e72e1c68a708518526b8e090f5d6482671cbd57.zip |
op-mode: T5051: use typing.Literal in op-mode scripts
Diffstat (limited to 'src/op_mode/conntrack.py')
-rwxr-xr-x | src/op_mode/conntrack.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/op_mode/conntrack.py b/src/op_mode/conntrack.py index df213cc5a..ea7c4c208 100755 --- a/src/op_mode/conntrack.py +++ b/src/op_mode/conntrack.py @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import sys +import typing import xmltodict from tabulate import tabulate @@ -23,6 +24,7 @@ from vyos.util import run import vyos.opmode +ArgFamily = typing.Literal['inet', 'inet6'] def _get_xml_data(family): """ @@ -126,7 +128,7 @@ def get_formatted_output(dict_data): return output -def show(raw: bool, family: str): +def show(raw: bool, family: ArgFamily): family = 'ipv6' if family == 'inet6' else 'ipv4' conntrack_data = _get_raw_data(family) if raw: |