~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ftp.py

  • Committer: Vincent Ladeuil
  • Date: 2007-10-17 17:22:26 UTC
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071017172226-335k9oh78ljavh54
Make http aware of authentication config.

* bzrlib/transport/ftp.py:
(FtpTransport._create_connection): Also provides port and path to
get_credentials since we know them.

* bzrlib/transport/http/_urllib2_wrappers.py:
(AbstractAuthHandler.get_password): Try the authentication config
before prompting the user.

* bzrlib/tests/test_http.py:
(TestAuth.test_no_prompt_for_password_when_using_auth_config):
Corresponding test (applies to raw http and proxy).

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
            if self._user and self._user != 'anonymous' and \
134
134
                    password is None: # '' is a valid password
135
135
                auth = config.AuthenticationConfig()
136
 
                config_credentials = auth.get_credentials('ftp', self._host,
137
 
                                                          user=self._user)
 
136
                config_credentials = auth.get_credentials(
 
137
                    'ftp', self._host, self._port, user=self._user,
 
138
                    path=self._path)
138
139
                if config_credentials is not None:
139
140
                    password = config_credentials['password']
140
141
                else: