Merge lp:~didrocks/unity/fix-bug-682314 into lp:unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Approved by: Neil J. Patel
Approved revision: no longer in the source branch.
Merged at revision: 637
Proposed branch: lp:~didrocks/unity/fix-bug-682314
Merge into: lp:unity
Diff against target: 17 lines (+5/-1)
1 file modified
tools/migrate_favorites.py (+5/-1)
To merge this branch: bzr merge lp:~didrocks/unity/fix-bug-682314
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+42102@code.launchpad.net

Description of the change

Fix bug #682314, only do migration if we have the right tools for it

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Looks good, approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/migrate_favorites.py'
2--- tools/migrate_favorites.py 2010-11-24 18:13:44 +0000
3+++ tools/migrate_favorites.py 2010-11-29 12:50:52 +0000
4@@ -60,8 +60,12 @@
5
6 return apps_list
7
8+try:
9+ migration_level = subprocess.Popen(["gsettings", "get", "com.canonical.Unity.Launcher", "favorite-migration"], stdout=subprocess.PIPE).communicate()[0].strip()[1:-1]
10+except OSError, e:
11+ print "Gsettings not executable or not installed, postponing migration. The error was: %s" % e
12+ sys.exit(1)
13
14-migration_level = subprocess.Popen(["gsettings", "get", "com.canonical.Unity.Launcher", "favorite-migration"], stdout=subprocess.PIPE).communicate()[0].strip()[1:-1]
15 if migration_level >= LAST_MIGRATION:
16 print "Migration already done"
17 sys.exit(0)