Skip to content

Commit

Permalink
fix(ps): bug where common path was not the parent dir of file
Browse files Browse the repository at this point in the history
ps now shows the directories from the common dir too

Signed-off-by: tjzegmott <[email protected]>
  • Loading branch information
tjzegmott committed May 17, 2023
1 parent 6483813 commit 3ba1969
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dtcli/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ def ps(scope: str, dataset: str, show_files: bool):

for se in files["file_replica_locations"]:
common_path = os.path.commonpath(files["file_replica_locations"][se])
names = [Path(_).name for _ in files["file_replica_locations"][se]]
names = [
Path(_).relative_to(common_path) for _ in files["file_replica_locations"][se]
]
for idx, fn in enumerate(names):
if idx == 0:
file_table.add_row(f"Storage Element: [magenta]{se}")
file_table.add_row(f"Common Path: {common_path}", style="bold green")
file_table.add_row(f"Common Path: {common_path}/", style="bold green")
file_table.add_row(f"[green]- {fn}")
# file_table.add_row(se, common_path, fn)
else:
Expand Down

0 comments on commit 3ba1969

Please sign in to comment.