mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Respect --quiet when looking up bundle cookie file
Change-Id: I02a244132c49e4bb50ecda978974d6d2b220f6d1
This commit is contained in:
parent
4abf8e6ef8
commit
497bde4de5
@ -1947,7 +1947,7 @@ class Project(object):
|
|||||||
os.remove(tmpPath)
|
os.remove(tmpPath)
|
||||||
if 'http_proxy' in os.environ and 'darwin' == sys.platform:
|
if 'http_proxy' in os.environ and 'darwin' == sys.platform:
|
||||||
cmd += ['--proxy', os.environ['http_proxy']]
|
cmd += ['--proxy', os.environ['http_proxy']]
|
||||||
with self._GetBundleCookieFile(srcUrl) as cookiefile:
|
with self._GetBundleCookieFile(srcUrl, quiet) as cookiefile:
|
||||||
if cookiefile:
|
if cookiefile:
|
||||||
cmd += ['--cookie', cookiefile, '--cookie-jar', cookiefile]
|
cmd += ['--cookie', cookiefile, '--cookie-jar', cookiefile]
|
||||||
if srcUrl.startswith('persistent-'):
|
if srcUrl.startswith('persistent-'):
|
||||||
@ -1996,7 +1996,7 @@ class Project(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def _GetBundleCookieFile(self, url):
|
def _GetBundleCookieFile(self, url, quiet):
|
||||||
if url.startswith('persistent-'):
|
if url.startswith('persistent-'):
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(
|
p = subprocess.Popen(
|
||||||
@ -2021,7 +2021,7 @@ class Project(object):
|
|||||||
err_msg = p.stderr.read()
|
err_msg = p.stderr.read()
|
||||||
if ' -print_config' in err_msg:
|
if ' -print_config' in err_msg:
|
||||||
pass # Persistent proxy doesn't support -print_config.
|
pass # Persistent proxy doesn't support -print_config.
|
||||||
else:
|
elif not quiet:
|
||||||
print(err_msg, file=sys.stderr)
|
print(err_msg, file=sys.stderr)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.ENOENT:
|
if e.errno == errno.ENOENT:
|
||||||
|
Loading…
Reference in New Issue
Block a user