Skip to content

Commit 6b32903

Browse files
committed
fix(ps): shows multiple larger datasets in belongs to
these are , separated if more than one lgr ds Signed-off-by: Tarik Zegmott <[email protected]>
1 parent 0e64c60 commit 6b32903

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dtcli/ps.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,12 @@ def create_policy_table(dataset: str, scope: str, policies: dict):
157157
show_footer=True,
158158
footer_style="bold red",
159159
)
160-
belongs_to = (
161-
policies["belongs_to"][0]["name"] if len(policies["belongs_to"]) > 0 else "None"
162-
)
160+
if len(policies["belongs_to"]) > 1:
161+
belongs_to = ", ".join([lgr_ds["name"] for lgr_ds in policies["belongs_to"]])
162+
elif len(policies["belongs_to"]) == 1:
163+
belongs_to = policies["belongs_to"][0]["name"]
164+
else:
165+
belongs_to = None
163166
policy_table.add_column("Policy", style="bold", footer="Belongs to")
164167
policy_table.add_column("Storage Element", footer=belongs_to)
165168
policy_table.add_column("Priority")

0 commit comments

Comments
 (0)