Skip to content

Commit d970379

Browse files
committed
Treat errors from external process
1 parent 99d5954 commit d970379

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/local/butler/scripts/migrate_blobs.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ def migrate_bucket(source_bucket, target_bucket):
9393

9494
assert bucket_exists
9595

96-
result = common.execute(f'gcloud storage rsync --recursive gs://{source_bucket} gs://{target_bucket}')
97-
print(result)
98-
99-
print(f'Migrated bucket contents from {source_bucket} to {target_bucket}')
96+
error_code, output = common.execute(f'gcloud storage rsync --recursive gs://{source_bucket} gs://{target_bucket}', exit_on_error=False)
97+
output_as_str = str(output)
98+
print(output_as_str)
99+
if error_code == 0:
100+
print(f'Migrated bucket contents from {source_bucket} to {target_bucket}')
101+
else:
102+
print(f'Failed to migrate bucket: {output_as_str}')
100103

101104
def migrate_data_bundle(data_bundle):
102105
'''

0 commit comments

Comments
 (0)