[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dbates at webkit.org dbates at webkit.org
Thu Apr 8 00:53:03 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit b5e62a8dd0c59642bdb05c53350a005ec5cf24d8
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 08:20:19 2010 +0000

    2010-01-04  Daniel Bates  <dbates at webkit.org>
    
            Reviewed by Eric Seidel.
    
            https://bugs.webkit.org/show_bug.cgi?id=33039
    
            [bzt] Second attempt to fix an issue where bugzilla-tool dies
            when the keychain lookup fails to find an entry for bugs.webkit.org.
    
            * Scripts/webkitpy/credentials.py:
            * Scripts/webkitpy/credentials_unittest.py:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 26447ed..5825007 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-04  Daniel Bates  <dbates at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33039
+
+        [bzt] Second attempt to fix an issue where bugzilla-tool dies
+        when the keychain lookup fails to find an entry for bugs.webkit.org.
+
+        * Scripts/webkitpy/credentials.py:
+        * Scripts/webkitpy/credentials_unittest.py:
+
 2010-01-04  Eric Seidel  <eric at webkit.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKitTools/Scripts/webkitpy/credentials.py b/WebKitTools/Scripts/webkitpy/credentials.py
index 0a38907..de74ba7 100644
--- a/WebKitTools/Scripts/webkitpy/credentials.py
+++ b/WebKitTools/Scripts/webkitpy/credentials.py
@@ -34,13 +34,11 @@ import os
 import platform
 import re
 
-from webkitpy.executive import Executive
+from webkitpy.executive import Executive, ScriptError
 from webkitpy.webkit_logging import log
 from webkitpy.scm import Git
 
 class Credentials(object):
-    keychain_entry_not_found = "security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain."
-
     def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd()):
         self.host = host
         self.git_prefix = git_prefix
@@ -63,8 +61,6 @@ class Credentials(object):
         return platform.mac_ver()[0]
 
     def _parse_security_tool_output(self, security_output):
-        if security_output == self.keychain_entry_not_found:
-            return [None, None]
         username = self._keychain_value_with_label("^\s*\"acct\"<blob>=", security_output)
         password = self._keychain_value_with_label("^password: ", security_output)
         return [username, password]
@@ -75,7 +71,13 @@ class Credentials(object):
             security_command += ["-a", username]
 
         log("Reading Keychain for %s account and password.  Click \"Allow\" to continue..." % self.host)
-        return self.executive.run_command(security_command)
+        try:
+            return self.executive.run_command(security_command)
+        except ScriptError:
+            # Failed to either find a keychain entry or somekind of OS-related error
+            # occured (for instance, couldn't find the /usr/sbin/security command).
+            log("Could not find a keychain entry for %s." % self.host)
+            return [None, None]
 
     def _credentials_from_keychain(self, username=None):
         if not self._is_mac_os_x():
diff --git a/WebKitTools/Scripts/webkitpy/credentials_unittest.py b/WebKitTools/Scripts/webkitpy/credentials_unittest.py
index ed36c26..bdf5142 100644
--- a/WebKitTools/Scripts/webkitpy/credentials_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/credentials_unittest.py
@@ -75,7 +75,15 @@ password: "SECRETSAUCE"
 
     def test_security_output_parse_entry_not_found(self):
         credentials = Credentials("foo.example.com")
-        self.assertEqual(credentials._parse_security_tool_output(Credentials.keychain_entry_not_found), [None, None])
+        if not credentials._is_mac_os_x():
+            return # This test does not run on a non-Mac.
+
+        # Note, we ignore the captured output because it is already covered
+        # by the test case CredentialsTest._assert_security_call (below).
+        outputCapture = OutputCapture()
+        outputCapture.capture_output()
+        self.assertEqual(credentials._run_security_tool(), [None, None])
+        outputCapture.restore_output()
 
     def _assert_security_call(self, username=None):
         executive_mock = Mock()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list