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
=== modified file 'softwarecenter/backend/login_sso.py'
--- softwarecenter/backend/login_sso.py 2012-01-05 09:53:52 +0000
+++ softwarecenter/backend/login_sso.py 2012-03-14 15:57:26 +0000
@@ -84,7 +84,7 @@
84 self._credentials = credentials84 self._credentials = credentials
85 85
8686
87 def _on_credentials_error(self, app_name, error, detailed_error):87 def _on_credentials_error(self, app_name, error, detailed_error=""):
88 LOG.error("_on_credentails_error for %s: %s (%s)" % (88 LOG.error("_on_credentails_error for %s: %s (%s)" % (
89 app_name, error, detailed_error))89 app_name, error, detailed_error))
90 if app_name != self.appname:90 if app_name != self.appname:
9191
=== modified file 'softwarecenter/utils.py'
--- softwarecenter/utils.py 2012-03-05 15:29:22 +0000
+++ softwarecenter/utils.py 2012-03-14 15:57:26 +0000
@@ -16,6 +16,7 @@
16# this program; if not, write to the Free Software Foundation, Inc.,16# this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
19import dbus
19import gettext20import gettext
20from gi.repository import GObject21from gi.repository import GObject
21from gi.repository import Gio22from gi.repository import Gio
@@ -327,7 +328,6 @@
327 """328 """
328 return True if Unity is currently running329 return True if Unity is currently running
329 """330 """
330 import dbus
331 unity_running = False331 unity_running = False
332 try:332 try:
333 bus = dbus.SessionBus()333 bus = dbus.SessionBus()
@@ -396,9 +396,17 @@
396 """ send a dbus signal to the com.ubuntu.sso service to clear 396 """ send a dbus signal to the com.ubuntu.sso service to clear
397 the credentials for the given appname, e.g. _("Ubuntu Software Center")397 the credentials for the given appname, e.g. _("Ubuntu Software Center")
398 """398 """
399 import dbus399 from ubuntu_sso import (
400 DBUS_BUS_NAME,
401 DBUS_CREDENTIALS_IFACE,
402 DBUS_CREDENTIALS_PATH,
403 )
400 bus = dbus.SessionBus()404 bus = dbus.SessionBus()
401 proxy = bus.get_object('com.ubuntu.sso', '/com/ubuntu/sso/credentials')405 obj = bus.get_object(bus_name=DBUS_BUS_NAME,
406 object_path=DBUS_CREDENTIALS_PATH,
407 follow_name_owner_changes=True)
408 proxy = dbus.Interface(object=obj,
409 dbus_interface=DBUS_CREDENTIALS_IFACE)
402 proxy.clear_credentials(appname, {})410 proxy.clear_credentials(appname, {})
403411
404def get_nice_date_string(cur_t):412def get_nice_date_string(cur_t):

Subscribers

People subscribed via source and target branches