Commit 8aee486f authored by deymo@chromium.org's avatar deymo@chromium.org

my_activity: Skip Rietveld cookie check if not found.

ChromiumOS only developers don't always have a Chromium checkout and
a Rietveld cookie file (~/.codereview_upload_cookies) with the auth
keys. This patch proceeds with the activity lookup from other
services such as Gerrit and GoB if there's no Rietveld cookie
present, displaying an error message when this happens.

BUG=chromium:316961
TEST=Remove ~/.codereview_upload_cookies and ran my_activity. ChromeOS activity listed.

Review URL: https://codereview.chromium.org/68763004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@234874 0039d316-1c4b-4281-b951-d872f2087c98
parent a738935a
......@@ -277,15 +277,17 @@ class MyActivity(object):
# authenticate to.
def check_cookies(self):
cookie_file = os.path.expanduser('~/.codereview_upload_cookies')
cookie_jar = cookielib.MozillaCookieJar(cookie_file)
if not os.path.exists(cookie_file):
exit(1)
try:
cookie_jar.load()
print 'Found cookie file: %s' % cookie_file
except (cookielib.LoadError, IOError):
exit(1)
print 'No Rietveld cookie file found.'
cookie_jar = []
else:
cookie_jar = cookielib.MozillaCookieJar(cookie_file)
try:
cookie_jar.load()
print 'Found cookie file: %s' % cookie_file
except (cookielib.LoadError, IOError):
print 'Error loading Rietveld cookie file: %s' % cookie_file
cookie_jar = []
filtered_instances = []
......
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