Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: mojo/public/tools/pylib/gs.py

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/tools/prepend.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6 import subprocess
7 import sys
8
9 def download_from_public_bucket(gs_path, output_path, depot_tools_path):
10 gsutil_exe = os.path.join(depot_tools_path, "third_party", "gsutil", "gsutil")
11
12 # We're downloading from a public bucket which does not need authentication,
13 # but the user might have busted credential files somewhere such as ~/.boto
14 # that the gsutil script will try (and fail) to use. Setting these
15 # environment variables convinces gsutil not to attempt to use these, but
16 # also generates a useless warning about failing to load the file. We want
17 # to discard this warning but still preserve all output in the case of an
18 # actual failure. So, we run the script and capture all output and then
19 # throw the output away if the script succeeds (return code 0).
20 env = os.environ.copy()
21 env["AWS_CREDENTIAL_FILE"] = ""
22 env["BOTO_CONFIG"] = ""
23 try:
24 subprocess.check_output(
25 [gsutil_exe,
26 "--bypass_prodaccess",
27 "cp",
28 gs_path,
29 output_path],
30 stderr=subprocess.STDOUT,
31 env=env)
32 except subprocess.CalledProcessError as e:
33 print e.output
34 sys.exit(1)
OLDNEW
« no previous file with comments | « mojo/public/tools/prepend.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698