Skip to content

Commit

Permalink
fix(ps): shows multiple larger datasets in belongs to
Browse files Browse the repository at this point in the history
these are , separated if more than one lgr ds

Signed-off-by: Tarik Zegmott <[email protected]>
  • Loading branch information
tjzegmott committed Apr 10, 2024
1 parent 0e64c60 commit 6b32903
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dtcli/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,12 @@ def create_policy_table(dataset: str, scope: str, policies: dict):
show_footer=True,
footer_style="bold red",
)
belongs_to = (
policies["belongs_to"][0]["name"] if len(policies["belongs_to"]) > 0 else "None"
)
if len(policies["belongs_to"]) > 1:
belongs_to = ", ".join([lgr_ds["name"] for lgr_ds in policies["belongs_to"]])
elif len(policies["belongs_to"]) == 1:
belongs_to = policies["belongs_to"][0]["name"]
else:
belongs_to = None
policy_table.add_column("Policy", style="bold", footer="Belongs to")
policy_table.add_column("Storage Element", footer=belongs_to)
policy_table.add_column("Priority")
Expand Down

0 comments on commit 6b32903

Please sign in to comment.