diff options
author | Daniil Baturin <daniil@vyos.io> | 2022-06-20 10:26:25 -0400 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2022-06-20 10:26:25 -0400 |
commit | 81f7df57eeb0714bda8d9103659e644de48d1dc9 (patch) | |
tree | b54442974bc95fec86a0d1a8a8cf650386548bee /python/vyos | |
parent | 651eb5794d22576d90ae8ff2fe0b1aeda92dd581 (diff) | |
download | vyos-1x-81f7df57eeb0714bda8d9103659e644de48d1dc9.tar.gz vyos-1x-81f7df57eeb0714bda8d9103659e644de48d1dc9.zip |
T2719: use _is_show for detecting show functions
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/opmode.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/opmode.py b/python/vyos/opmode.py index 270adc658..134f55017 100644 --- a/python/vyos/opmode.py +++ b/python/vyos/opmode.py @@ -84,7 +84,7 @@ def run(module): # Show commands require an option to choose between raw JSON and human-readable # formatted output. # For interactive use, they default to formatted output. - if (function_name == "show") and (opt == "raw"): + if _is_show(function_name) and (opt == "raw"): subparser.add_argument(f"--raw", action='store_true') elif _is_optional_type(th): subparser.add_argument(f"--{opt}", type=_get_arg_type(th), default=None) @@ -110,7 +110,7 @@ def run(module): # Show commands must always get the "raw" argument, # but other commands (clear/reset/restart) should not, # because they produce no output and it makes no sense for them. - if ("raw" not in args) and re.match(r"^show", function_name): + if ("raw" not in args) and _is_show(function_name): args["raw"] = False if re.match(r"^show", function_name): |