Merge lp:~laney/ubuntu-system-settings/migration-script-no-crash into lp:ubuntu-system-settings

Proposed by Iain Lane
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 644
Merged at revision: 647
Proposed branch: lp:~laney/ubuntu-system-settings/migration-script-no-crash
Merge into: lp:ubuntu-system-settings
Diff against target: 25 lines (+6/-2)
1 file modified
debian/ubuntu-system-settings-sound-gsettings-to-accountsservice.py (+6/-2)
To merge this branch: bzr merge lp:~laney/ubuntu-system-settings/migration-script-no-crash
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+210005@code.launchpad.net

Commit message

Don't crash if the migration script can't set values

Description of the change

If you're not authorised to write to AS, the migration script crashes. There's not a lot we can do to rectify the situation, but fix the crash by catching it and writing an error.

Actually, we don't have error handling in u-s-s for this case either. It's not massively urgent to fix - this is quite niche & we don't have a generic 'error state' which we'd want to use.

Put something like this in a pkla file & then run the script to repro this bug

[NO]
Identity=unix-user:laney
Action=org.freedesktop.accounts.change-own-user-data
ResultActive=no

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:644
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~laney/ubuntu-system-settings/migration-script-no-crash/+merge/210005/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/684/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3760
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3348
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-trusty-amd64-ci/200
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-trusty-armhf-ci/188
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-trusty-i386-ci/187
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3306
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3768
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3768/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3350
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3350/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5719
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4592

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/684/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

ok!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/ubuntu-system-settings-sound-gsettings-to-accountsservice.py' (properties changed: -x to +x)
2--- debian/ubuntu-system-settings-sound-gsettings-to-accountsservice.py 2014-01-09 13:02:44 +0000
3+++ debian/ubuntu-system-settings-sound-gsettings-to-accountsservice.py 2014-03-07 19:41:04 +0000
4@@ -23,6 +23,7 @@
5
6 import dbus
7 import os
8+import sys
9
10 from gi.repository import Gio
11
12@@ -42,8 +43,11 @@
13 return gsettings.get_boolean(key)
14
15 def set_as_setting(interface, setting, value):
16- user_proxy.Set(interface, setting, value,
17- dbus_interface=dbus.PROPERTIES_IFACE)
18+ try:
19+ user_proxy.Set(interface, setting, value,
20+ dbus_interface=dbus.PROPERTIES_IFACE)
21+ except dbus.exceptions.DBusException as e:
22+ print("Couldn't update %s: %s" % (setting, e), file=sys.stderr)
23
24 # (gsettings key, accountsservice key, function to retrieve from gsettings)
25 keys = [('silent-mode', 'SilentMode', get_bool),

Subscribers

People subscribed via source and target branches