Rev 2921: Make lp_registration aware of authentication config. in http://code.launchpad.net/%7Ev-ladeuil/bzr/auth.ring
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Oct 23 13:50:32 BST 2007
At http://code.launchpad.net/%7Ev-ladeuil/bzr/auth.ring
------------------------------------------------------------
revno: 2921
revision-id:v.ladeuil+lp at free.fr-20071023125011-xfe73s1iki0wpl2w
parent: v.ladeuil+lp at free.fr-20071023105809-gtokg8o2zd0oeuyl
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: auth.ring
timestamp: Tue 2007-10-23 14:50:11 +0200
message:
Make lp_registration aware of authentication config.
* bzrlib/plugins/launchpad/lp_registration.py:
(LaunchpadService.gather_user_credentials):
modified:
bzrlib/plugins/launchpad/lp_registration.py lp_registration.py-20060315190948-daa617eafe3a8d48
-------------- next part --------------
=== modified file 'bzrlib/plugins/launchpad/lp_registration.py'
--- a/bzrlib/plugins/launchpad/lp_registration.py 2007-10-22 15:18:24 +0000
+++ b/bzrlib/plugins/launchpad/lp_registration.py 2007-10-23 12:50:11 +0000
@@ -21,8 +21,10 @@
import urllib
import xmlrpclib
-import bzrlib.config
-import bzrlib.errors as errors
+from bzrlib import (
+ config,
+ errors,
+ )
# for testing, do
'''
@@ -92,13 +94,17 @@
def gather_user_credentials(self):
"""Get the password from the user."""
- # FIXME: query AuthenticationConfig too
- config = bzrlib.config.GlobalConfig()
+ config = config.GlobalConfig()
self.registrant_email = config.user_email()
if self.registrant_password is None:
+ auth = config.AuthenticationConfig()
+ scheme, hostinfo = urlsplit(self.service_url)[:2]
prompt = 'launchpad.net password for %s: ' % \
self.registrant_email
- self.registrant_password = getpass(prompt)
+ # We will reuse http[s] credentials if we can, prompt user
+ # otherwise
+ self.registrant_password = auth.get_password(scheme, hostinfo,
+ prompt=prompt)
def send_request(self, method_name, method_params):
proxy = self.get_proxy()
More information about the bazaar-commits
mailing list