Merge lp:~mvo/software-center/small-sso-fixes into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 2852
Proposed branch: lp:~mvo/software-center/small-sso-fixes
Merge into: lp:software-center
Diff against target: 52 lines (+12/-4)
2 files modified
softwarecenter/backend/login_sso.py (+1/-1)
softwarecenter/utils.py (+11/-3)
To merge this branch: bzr merge lp:~mvo/software-center/small-sso-fixes
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+97435@code.launchpad.net

Description of the change

This fixes the clear_credentials() call if a token is no longer valid.

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Looks great, thanks mvo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/login_sso.py'
2--- softwarecenter/backend/login_sso.py 2012-01-05 09:53:52 +0000
3+++ softwarecenter/backend/login_sso.py 2012-03-14 15:57:26 +0000
4@@ -84,7 +84,7 @@
5 self._credentials = credentials
6
7
8- def _on_credentials_error(self, app_name, error, detailed_error):
9+ def _on_credentials_error(self, app_name, error, detailed_error=""):
10 LOG.error("_on_credentails_error for %s: %s (%s)" % (
11 app_name, error, detailed_error))
12 if app_name != self.appname:
13
14=== modified file 'softwarecenter/utils.py'
15--- softwarecenter/utils.py 2012-03-05 15:29:22 +0000
16+++ softwarecenter/utils.py 2012-03-14 15:57:26 +0000
17@@ -16,6 +16,7 @@
18 # this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21+import dbus
22 import gettext
23 from gi.repository import GObject
24 from gi.repository import Gio
25@@ -327,7 +328,6 @@
26 """
27 return True if Unity is currently running
28 """
29- import dbus
30 unity_running = False
31 try:
32 bus = dbus.SessionBus()
33@@ -396,9 +396,17 @@
34 """ send a dbus signal to the com.ubuntu.sso service to clear
35 the credentials for the given appname, e.g. _("Ubuntu Software Center")
36 """
37- import dbus
38+ from ubuntu_sso import (
39+ DBUS_BUS_NAME,
40+ DBUS_CREDENTIALS_IFACE,
41+ DBUS_CREDENTIALS_PATH,
42+ )
43 bus = dbus.SessionBus()
44- proxy = bus.get_object('com.ubuntu.sso', '/com/ubuntu/sso/credentials')
45+ obj = bus.get_object(bus_name=DBUS_BUS_NAME,
46+ object_path=DBUS_CREDENTIALS_PATH,
47+ follow_name_owner_changes=True)
48+ proxy = dbus.Interface(object=obj,
49+ dbus_interface=DBUS_CREDENTIALS_IFACE)
50 proxy.clear_credentials(appname, {})
51
52 def get_nice_date_string(cur_t):

Subscribers

People subscribed via source and target branches