From 8792e13f80f4150fbe2dae5d8eedf7f40703411e Mon Sep 17 00:00:00 2001 From: zsdc Date: Tue, 30 Aug 2022 15:10:36 +0300 Subject: opmode: T4657: fixed opmode with return type hints This commit excludes `return` from `typing.get_type_hints()` output, which allows generate argparse arguments for function properly. --- python/vyos/opmode.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/vyos/opmode.py b/python/vyos/opmode.py index 628f7b3a2..7e3545c87 100644 --- a/python/vyos/opmode.py +++ b/python/vyos/opmode.py @@ -105,6 +105,8 @@ def run(module): subparser = subparsers.add_parser(function_name, help=functions[function_name].__doc__) type_hints = typing.get_type_hints(functions[function_name]) + if 'return' in type_hints: + del type_hints['return'] for opt in type_hints: th = type_hints[opt] -- cgit v1.2.3