Merge lp:~andreagrandi/ubuntu-accomplishments-system/daemon-crash into lp:~jonobacon/ubuntu-accomplishments-system/trophyinfo

Proposed by Andrea Grandi
Status: Rejected
Rejected by: Jono Bacon
Proposed branch: lp:~andreagrandi/ubuntu-accomplishments-system/daemon-crash
Merge into: lp:~jonobacon/ubuntu-accomplishments-system/trophyinfo
Diff against target: 18 lines (+7/-1)
1 file modified
daemon/libaccomplishments-daemon/daemon.py (+7/-1)
To merge this branch: bzr merge lp:~andreagrandi/ubuntu-accomplishments-system/daemon-crash
Reviewer Review Type Date Requested Status
Jono Bacon Pending
Review via email: mp+95003@code.launchpad.net

Description of the change

Fix a crash of the Ubuntu Accomplishments System daemon that occurs when user has not configured an Ubuntu One account yet.

To post a comment you must log in.
Revision history for this message
Jono Bacon (jonobacon) wrote :

Just to let you know, Andrea, I am holding off merging this in until I have merged in Duncan's branch as his branch moves a lot of code around. I will then merge in these changes then. Thanks!

Revision history for this message
Andrea Grandi (andreagrandi) wrote :

It's ok Jono, feel free to merge it when you need it :)

Revision history for this message
Jono Bacon (jonobacon) wrote :

It looks like Duncan fixed this when he created his branch, but thanks for sharing this, Andrea!

Unmerged revisions

65. By Andrea Grandi

Daemon doesn't crash anymore if you didn't configure an Ubuntu One account.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'daemon/libaccomplishments-daemon/daemon.py'
2--- daemon/libaccomplishments-daemon/daemon.py 2012-02-24 06:08:50 +0000
3+++ daemon/libaccomplishments-daemon/daemon.py 2012-02-28 17:34:23 +0000
4@@ -287,7 +287,13 @@
5 def verifyU1Account(self):
6 # check if this machine has an Ubuntu One account
7 logging.info("Check if this machine has an Ubuntu One account...")
8- u1email = json.loads(auth.request(url='https://one.ubuntu.com/api/account/')[1])['email']
9+
10+ u1email = None
11+
12+ try:
13+ u1email = json.loads(auth.request(url='https://one.ubuntu.com/api/account/')[1])['email']
14+ except Exception, (msg):
15+ print "WARNING: You need to configure an Ubuntu One account first!"
16
17 if u1email is None:
18 logging.info("...No.")

Subscribers

People subscribed via source and target branches