Commit 8f4a7c49 authored by eric@webkit.org's avatar eric@webkit.org

2010-01-28 Joe Mason <jmason@rim.com>

        Reviewed by Adam Barth.

        Limit login retries to 5
        https://bugs.webkit.org/show_bug.cgi?id=34193

        * Scripts/webkitpy/bugzilla.py:

git-svn-id: svn://svn.chromium.org/blink/trunk@53976 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent dfe59e32
2010-01-28 Joe Mason <jmason@rim.com>
Reviewed by Adam Barth.
Limit login retries to 5
https://bugs.webkit.org/show_bug.cgi?id=34193
* Scripts/webkitpy/bugzilla.py:
2010-01-27 Martin Robinson <mrobinson@webkit.org> 2010-01-27 Martin Robinson <mrobinson@webkit.org>
Adding myself to the committer list. No review necessary. Adding myself to the committer list. No review necessary.
......
...@@ -467,7 +467,9 @@ class Bugzilla(object): ...@@ -467,7 +467,9 @@ class Bugzilla(object):
self.authenticated = True self.authenticated = True
return return
attempts = 0
while not self.authenticated: while not self.authenticated:
attempts += 1
(username, password) = Credentials( (username, password) = Credentials(
self.bug_server_host, git_prefix="bugzilla").read_credentials() self.bug_server_host, git_prefix="bugzilla").read_credentials()
...@@ -483,7 +485,12 @@ class Bugzilla(object): ...@@ -483,7 +485,12 @@ class Bugzilla(object):
# If the resulting page has a title, and it contains the word # If the resulting page has a title, and it contains the word
# "invalid" assume it's the login failure page. # "invalid" assume it's the login failure page.
if match and re.search("Invalid", match.group(1), re.IGNORECASE): if match and re.search("Invalid", match.group(1), re.IGNORECASE):
log("Bugzilla login failed: %s" % match.group(1)) errorMessage = "Bugzilla login failed: %s" % match.group(1)
# raise an exception only if this was the last attempt
if attempts < 5:
log(errorMessage)
else:
raise Exception(errorMessage)
else: else:
self.authenticated = True self.authenticated = True
......
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