diff --git a/dtcli/ps.py b/dtcli/ps.py index 0ba7467..f8caddb 100644 --- a/dtcli/ps.py +++ b/dtcli/ps.py @@ -37,7 +37,10 @@ def ps(scope: str, dataset: str, show_files: bool): info_table.add_column("Size of Files [GB]", style="green") if files["file_replica_locations"].get("minoc"): minoc_files = files["file_replica_locations"]["minoc"] - size = cadcclient.size(os.path.commonpath(minoc_files)) + common_path = os.path.commonpath(minoc_files) + if not common_path.startswith("data") or not common_path.startswith("/data"): + common_path = common_path.replace("cadc:CHIMEFRB", "") + size = cadcclient.size(common_path) info_table.add_row("minoc", f"{len(minoc_files)}", f"{size:.2f}") else: info_table.add_row("minoc", str(0), str(0)) diff --git a/dtcli/pull.py b/dtcli/pull.py index 63ad5af..52ccf89 100644 --- a/dtcli/pull.py +++ b/dtcli/pull.py @@ -90,7 +90,10 @@ def pull( # Find files missing from localhost. console.print(f"\nSearching for files for {dataset} {scope}...\n") files = find_missing_dataset_files(scope, dataset) - to_download_size = size(path.commonpath(files["missing"])) + common_path = path.commonpath(files["missing"]) + if common_path.startswith("cadc:CHIMEFRB"): + common_path = common_path.replace("cadc:CHIMEFRB", "") + to_download_size = size(common_path) console.print( f" - {len(files['existing'])} files found at {site}.", style="green",