From 81f7df57eeb0714bda8d9103659e644de48d1dc9 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 20 Jun 2022 10:26:25 -0400 Subject: T2719: use _is_show for detecting show functions --- python/vyos/opmode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/vyos/opmode.py') 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): -- cgit v1.2.3