summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2022-08-30 15:10:36 +0300
committerzsdc <taras@vyos.io>2022-08-30 15:10:36 +0300
commit8792e13f80f4150fbe2dae5d8eedf7f40703411e (patch)
treeab9bf9cd34aefdad0170b75521ed7243b58542e1
parentb01f27b3bb3f4cbc6096011856d83009d0440313 (diff)
downloadvyos-1x-8792e13f80f4150fbe2dae5d8eedf7f40703411e.tar.gz
vyos-1x-8792e13f80f4150fbe2dae5d8eedf7f40703411e.zip
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.
-rw-r--r--python/vyos/opmode.py2
1 files changed, 2 insertions, 0 deletions
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]