Rev 3421: (vila) Fix 199440 by taking allowing no password in a section in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri May 9 20:10:03 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3421
revision-id:pqm at pqm.ubuntu.com-20080509190952-oqlrpkxzoruxymko
parent: pqm at pqm.ubuntu.com-20080509175237-wexvavsbk1x3qf38
parent: v.ladeuil+lp at free.fr-20080509140925-f63cs25o196nol4y
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-05-09 20:09:52 +0100
message:
  (vila) Fix 199440 by taking allowing no password in a section
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
    ------------------------------------------------------------
    revno: 3418.4.2
    revision-id:v.ladeuil+lp at free.fr-20080509140925-f63cs25o196nol4y
    parent: v.ladeuil+lp at free.fr-20080509135753-u6wb65wyiodxlfga
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 199440-auth-ssh-user-no-pass
    timestamp: Fri 2008-05-09 16:09:25 +0200
    message:
      Fix bug #199440 by taking into account that a section may not
      define a password.
      
      * bzrlib/config.py:
      (AuthenticationConfig.get_credentials): A section may contain no
      password.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
    ------------------------------------------------------------
    revno: 3418.4.1
    revision-id:v.ladeuil+lp at free.fr-20080509135753-u6wb65wyiodxlfga
    parent: pqm at pqm.ubuntu.com-20080508230313-knn3ibom6wt27w5k
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 199440-auth-ssh-user-no-pass
    timestamp: Fri 2008-05-09 15:57:53 +0200
    message:
      Reproduce bug 199440.
      
      * bzrlib/tests/test_config.py:
      (TestAuthenticationConfigFile.test_credentials_for_user_without_password):
      Reproduce bug.
    modified:
      bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
=== modified file 'NEWS'
--- a/NEWS	2008-05-09 17:52:37 +0000
+++ b/NEWS	2008-05-09 19:09:52 +0000
@@ -32,6 +32,9 @@
 
   BUGFIXES:
 
+    * Authentication.conf can define sections without password.
+      (Vincent Ladeuil, #199440)
+
     * Avoid muttering every time a child update does not cause a progress bar
       update. (John Arbash Meinel, #213771)
 

=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2008-05-09 08:32:29 +0000
+++ b/bzrlib/config.py	2008-05-09 19:09:52 +0000
@@ -1034,7 +1034,8 @@
                 # Can't find a user
                 continue
             credentials = dict(name=auth_def_name,
-                               user=a_user, password=auth_def['password'],
+                               user=a_user,
+                               password=auth_def.get('password', None),
                                verify_certificates=a_verify_certificates)
             self.decode_password(credentials,
                                  auth_def.get('password_encoding', None))

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2008-05-09 08:32:29 +0000
+++ b/bzrlib/tests/test_config.py	2008-05-09 19:09:52 +0000
@@ -1337,6 +1337,18 @@
         self._got_user_passwd(None, None,
                               conf, 'http', 'bar.org', user='georges')
 
+    def test_credentials_for_user_without_password(self):
+        conf = config.AuthenticationConfig(_file=StringIO(
+                """
+[without password]
+scheme=http
+host=bar.org
+user=jim
+"""))
+        # Get user but no password
+        self._got_user_passwd('jim', None,
+                              conf, 'http', 'bar.org')
+
     def test_verify_certificates(self):
         conf = config.AuthenticationConfig(_file=StringIO(
                 """




More information about the bazaar-commits mailing list