diff options
author | Daniil Baturin <daniil@vyos.io> | 2023-03-07 19:51:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 19:51:18 +0000 |
commit | 06e810ffc398366f7d4cc00241e0692e6fe81620 (patch) | |
tree | a1e2d444b83eadbb8f0e7f43b6493a03c6f90c8a /src/op_mode/conntrack.py | |
parent | 9f0857c2e7821ea22d5132d6352ee8cbcb64b738 (diff) | |
parent | 1e72e1c68a708518526b8e090f5d6482671cbd57 (diff) | |
download | vyos-1x-06e810ffc398366f7d4cc00241e0692e6fe81620.tar.gz vyos-1x-06e810ffc398366f7d4cc00241e0692e6fe81620.zip |
Merge pull request #1868 from jestabro/literal
op-mode: T5051: use Literal types to provide op-mode CLI choices and API enums
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: |