mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
only build VRF help if query type is enabled
This commit is contained in:
@@ -373,25 +373,32 @@ def _build_vrf_help():
|
|||||||
vrf_help = {}
|
vrf_help = {}
|
||||||
for command in SUPPORTED_QUERY_TYPES:
|
for command in SUPPORTED_QUERY_TYPES:
|
||||||
cmd = getattr(vrf.info, command)
|
cmd = getattr(vrf.info, command)
|
||||||
help_params = {**content_params, **cmd.params.dict()}
|
if cmd.enable:
|
||||||
|
help_params = {**content_params, **cmd.params.dict()}
|
||||||
|
|
||||||
if help_params["title"] is None:
|
if help_params["title"] is None:
|
||||||
command_params = getattr(params.queries, command)
|
command_params = getattr(params.queries, command)
|
||||||
help_params[
|
help_params[
|
||||||
"title"
|
"title"
|
||||||
] = f"{vrf.display_name}: {command_params.display_name}"
|
] = f"{vrf.display_name}: {command_params.display_name}"
|
||||||
|
|
||||||
md = aiorun(
|
md = aiorun(
|
||||||
get_markdown(
|
get_markdown(
|
||||||
config_path=cmd,
|
config_path=cmd,
|
||||||
default=DEFAULT_DETAILS[command],
|
default=DEFAULT_DETAILS[command],
|
||||||
params=help_params,
|
params=help_params,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
vrf_help.update(
|
vrf_help.update(
|
||||||
{command: {"content": md, "enable": cmd.enable, "params": help_params}}
|
{
|
||||||
)
|
command: {
|
||||||
|
"content": md,
|
||||||
|
"enable": cmd.enable,
|
||||||
|
"params": help_params,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
all_help.update({vrf.name: vrf_help})
|
all_help.update({vrf.name: vrf_help})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user