Skip to content

Commit 9bf85a9

Browse files
authored
fix: Migrate gsutil usage to gcloud storage (GoogleCloudPlatform#1121)
Migrate `gsutil` usage to `gcloud` storage in `gcs.py`.
1 parent 8f2e872 commit 9bf85a9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

xlml/apis/gcs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ def load_yaml_from_gcs(gcs_path: str) -> dict:
114114
temp_file_path = os.path.join(tmpdir, "downloaded_config")
115115

116116
hook = SubprocessHook()
117-
command = ["gsutil", "-m", "cp", gcs_path, temp_file_path]
117+
command = ["gcloud", "storage", "cp", gcs_path, temp_file_path]
118118
logging.info(f"Running command: {' '.join(command)}")
119119
result = hook.run_command(command)
120120
assert (
121121
result.exit_code == 0
122-
), f"gsutil command failed with exit code {result.exit_code}"
122+
), f"gcloud storage command failed with exit code {result.exit_code}"
123123

124124
if not os.path.exists(temp_file_path):
125125
logging.error(
126-
f"gsutil cp command completed, but '{temp_file_path}' was not created. "
127-
"This often means the copy failed. Check gsutil stdout/stderr in logs."
126+
f"gcloud storage cp command completed, but '{temp_file_path}' was not created. "
127+
"This often means the copy failed. Check gcloud storage stdout/stderr in logs."
128128
)
129129
raise FileNotFoundError(
130130
f"[Errno 2] Failed to download file from GCS path: {gcs_path}"

0 commit comments

Comments
 (0)