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/route.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/route.py')
-rwxr-xr-x | src/op_mode/route.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/op_mode/route.py b/src/op_mode/route.py index 7f0f9cbac..d6d6b7d6f 100755 --- a/src/op_mode/route.py +++ b/src/op_mode/route.py @@ -54,7 +54,9 @@ frr_command_template = Template(""" {% endif %} """) -def show_summary(raw: bool, family: str, table: typing.Optional[int], vrf: typing.Optional[str]): +ArgFamily = typing.Literal['inet', 'inet6'] + +def show_summary(raw: bool, family: ArgFamily, table: typing.Optional[int], vrf: typing.Optional[str]): from vyos.util import cmd if family == 'inet': @@ -94,7 +96,7 @@ def show_summary(raw: bool, family: str, table: typing.Optional[int], vrf: typin return output def show(raw: bool, - family: str, + family: ArgFamily, net: typing.Optional[str], table: typing.Optional[int], protocol: typing.Optional[str], |