Skip to content

Commit 57c2694

Browse files
authored
Merge pull request #206 from JenySadadia/validate-boots-list-view
Boots validation: enable list view
2 parents 0633c21 + d9d42d8 commit 57c2694

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

kcidev/subcommands/maestro/validate/boots.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from kcidev.libs.git_repo import get_tree_name, set_giturl_branch_commit
44
from kcidev.subcommands.results import trees
55

6-
from .helper import get_boot_stats, print_table_stats
6+
from .helper import get_boot_stats, print_simple_list, print_table_stats
77

88

99
@click.command(
@@ -69,6 +69,12 @@
6969
default=False,
7070
help="Get detailed output",
7171
)
72+
@click.option(
73+
"--table-output",
74+
is_flag=True,
75+
default=False,
76+
help="Display results in table format",
77+
)
7278
@click.pass_context
7379
def boots(
7480
ctx,
@@ -82,6 +88,7 @@ def boots(
8288
arch,
8389
days,
8490
verbose,
91+
table_output,
8592
):
8693
final_stats = []
8794
print("Fetching boot information...")
@@ -121,4 +128,7 @@ def boots(
121128
]
122129
max_col_width = [None, 40, 3, 3, 2, 30, 30]
123130
table_fmt = "simple_grid"
124-
print_table_stats(final_stats, headers, max_col_width, table_fmt)
131+
if table_output:
132+
print_table_stats(final_stats, headers, max_col_width, table_fmt)
133+
else:
134+
print_simple_list(final_stats, "boots", False)

kcidev/subcommands/maestro/validate/helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ def get_boots(ctx, giturl, branch, commit, arch):
285285
return maestro_boots, None
286286
except click.ClickException as e:
287287
kci_msg_red(f"{branch}/{commit}: {e.message}")
288+
if "No boots available" in e.message:
289+
return maestro_boots, []
288290
return maestro_boots, None
289291
return maestro_boots, dashboard_boots
290292

0 commit comments

Comments
 (0)