Add an alternate default boto file for bootstrapping source.

Able to pull internal tools, but distinct from the source that
those tools may eventually build.

TBR=cmp@chromium.org
BUG=252226
TEST=local buildslave

Review URL: https://chromiumcodereview.appspot.com/17351008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@209166 0039d316-1c4b-4281-b951-d872f2087c98
parent d4fffee1
......@@ -42,23 +42,29 @@ class Gsutil(object):
self.timeout = timeout
self.boto_path = boto_path
def call(self, *args):
def get_sub_env(self):
env = os.environ.copy()
if self.boto_path:
env['AWS_CREDENTIAL_FILE'] = self.boto_path
else:
custompath = env.get('AWS_CREDENTIAL_FILE', '~/.boto') + '.depot_tools'
custompath = os.path.expanduser(custompath)
if os.path.exists(custompath):
env['AWS_CREDENTIAL_FILE'] = custompath
return env
def call(self, *args):
return subprocess2.call((sys.executable, self.path) + args,
env=env,
env=self.get_sub_env(),
timeout=self.timeout)
def check_call(self, *args):
env = os.environ.copy()
if self.boto_path:
env['AWS_CREDENTIAL_FILE'] = self.boto_path
((out, err), code) = subprocess2.communicate(
(sys.executable, self.path) + args,
stdout=subprocess2.PIPE,
stderr=subprocess2.PIPE,
env=env,
env=self.get_sub_env(),
timeout=self.timeout)
# Parse output.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment