From 1e72e1c68a708518526b8e090f5d6482671cbd57 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 3 Mar 2023 11:30:27 -0600 Subject: op-mode: T5051: use typing.Literal in op-mode scripts --- src/op_mode/conntrack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/op_mode/conntrack.py') 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 . 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: -- cgit v1.2.3