Merge lp:~nataliabidart/ubuntu-sso-client/add-debug into lp:ubuntu-sso-client

Proposed by Natalia Bidart on 2010-08-24
Status: Merged
Approved by: Alejandro J. Cura on 2010-08-24
Approved revision: 586
Merged at revision: 585
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/add-debug
Merge into: lp:ubuntu-sso-client
Diff against target: 43 lines (+11/-0)
1 file modified
ubuntu_sso/main.py (+11/-0)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/add-debug
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve on 2010-08-24
Rodrigo Moya (community) 2010-08-24 Approve on 2010-08-24
Review via email: mp+33529@code.launchpad.net

Commit Message

A few debug messages.

Description of the Change

A few debug messages.

To post a comment you must log in.
review: Approve
Alejandro J. Cura (alecu) wrote :

No tests!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/main.py'
2--- ubuntu_sso/main.py 2010-08-24 13:46:12 +0000
3+++ ubuntu_sso/main.py 2010-08-24 14:19:39 +0000
4@@ -103,13 +103,18 @@
5
6 def keyring_store_credentials(app_name, credentials):
7 """Store the credentials in the keyring."""
8+ logger.debug('keyring_store_credentials: app_name %r.', app_name)
9 Keyring(app_name).set_ubuntusso_attr(credentials)
10
11
12 def keyring_get_credentials(app_name):
13 """Get the credentials from the keyring or None if not there."""
14+ logger.debug('keyring_get_credentials: app_name %r', app_name)
15 creds = Keyring(app_name).get_ubuntusso_attr()
16+ logger.debug('keyring_get_credentials: Keyring returned credentials? %r',
17+ creds is not None)
18 if creds is None and app_name == U1_APP_NAME:
19+ logger.debug('keyring_get_credentials: trying for old service.')
20 # No new creds, try to get old credentials
21 old_creds = Keyring(OLD_KEY_NAME).get_ubuntusso_attr()
22 if old_creds is not None:
23@@ -121,6 +126,8 @@
24 'token': old_creds["oauth_token"],
25 'token_secret': old_creds["oauth_token_secret"],
26 }
27+ else:
28+ logger.debug('keyring_get_credentials: Keyring returned credentials.')
29 return creds
30
31
32@@ -373,7 +380,11 @@
33 def f():
34 """Inner function that will be run in a thread."""
35 token_name = get_token_name(app_name)
36+ logger.debug('login: token_name %r, email %r, password <hidden>.',
37+ token_name, email)
38 credentials = self.processor().login(email, password, token_name)
39+ logger.debug('login returned not None credentials? %r.',
40+ credentials is not None)
41 assert credentials is not None
42 keyring_store_credentials(app_name, credentials)
43 return email

Subscribers

People subscribed via source and target branches