Changeset 53733 in webkit


Ignore:
Timestamp:
Jan 22, 2010 4:12:12 PM (14 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Adam Barth.

webkit-patch should retry on invalid password
https://bugs.webkit.org/show_bug.cgi?id=33955

Ask for bugs.webkit.org authentication in a loop.

  • Scripts/webkitpy/bugzilla.py:
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r53731 r53733  
     12010-01-21  Joe Mason  <jmason@rim.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        webkit-patch should retry on invalid password
     6        https://bugs.webkit.org/show_bug.cgi?id=33955
     7
     8        Ask for bugs.webkit.org authentication in a loop.
     9
     10        * Scripts/webkitpy/bugzilla.py:
     11
    1122010-01-22  Adam Barth  <abarth@webkit.org>
    213
  • trunk/WebKitTools/Scripts/webkitpy/bugzilla.py

    r53729 r53733  
    1 # Copyright (c) 2009, Google Inc. All rights reserved.
     1# Copyright (c) 2009 Google Inc. All rights reserved.
    22# Copyright (c) 2009 Apple Inc. All rights reserved.
     3# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
    34#
    45# Redistribution and use in source and binary forms, with or without
     
    467468            return
    468469
    469         (username, password) = Credentials(
     470        while not self.authenticated:
     471            (username, password) = Credentials(
    470472                self.bug_server_host, git_prefix="bugzilla").read_credentials()
    471473
    472         log("Logging in as %s..." % username)
    473         self.browser.open(self.bug_server_url + "index.cgi?GoAheadAndLogIn=1")
    474         self.browser.select_form(name="login")
    475         self.browser['Bugzilla_login'] = username
    476         self.browser['Bugzilla_password'] = password
    477         response = self.browser.submit()
    478 
    479         match = re.search("<title>(.+?)</title>", response.read())
    480         # If the resulting page has a title, and it contains the word "invalid"
    481         # assume it's the login failure page.
    482         if match and re.search("Invalid", match.group(1), re.IGNORECASE):
    483             # FIXME: We could add the ability to try again on failure.
    484             raise Exception("Bugzilla login failed: %s" % match.group(1))
    485 
    486         self.authenticated = True
     474            log("Logging in as %s..." % username)
     475            self.browser.open(self.bug_server_url +
     476                              "index.cgi?GoAheadAndLogIn=1")
     477            self.browser.select_form(name="login")
     478            self.browser['Bugzilla_login'] = username
     479            self.browser['Bugzilla_password'] = password
     480            response = self.browser.submit()
     481
     482            match = re.search("<title>(.+?)</title>", response.read())
     483            # If the resulting page has a title, and it contains the word
     484            # "invalid" assume it's the login failure page.
     485            if match and re.search("Invalid", match.group(1), re.IGNORECASE):
     486                log("Bugzilla login failed: %s" % match.group(1))
     487            else:
     488                self.authenticated = True
    487489
    488490    def _fill_attachment_form(self,
Note: See TracChangeset for help on using the changeset viewer.