Merge lp:~elachuni/software-center/unify-ussoc-envvar into lp:software-center

Proposed by Anthony Lenton
Status: Merged
Merged at revision: 2847
Proposed branch: lp:~elachuni/software-center/unify-ussoc-envvar
Merge into: lp:software-center
Diff against target: 35 lines (+7/-6)
2 files modified
softwarecenter/enums.py (+4/-4)
utils/piston-helpers/piston_generic_helper.py (+3/-2)
To merge this branch: bzr merge lp:~elachuni/software-center/unify-ussoc-envvar
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+97273@code.launchpad.net

Description of the change

This branch unifies what USC and ussoc expect from the USSOC_SERVICE_URL environment variable

the Ubuntu SSO Client expects USSOC_SERVICE_URL to be a full uri to the sso service root, like "https://login.staging.ubuntu.com/api/1.0". USC, instead, expected this same variable to be just the hostname, as in "https://login.staging.ubuntu.com/". This meant that you couldn't pass in any value for this variable that would make both work. As a consequence, there is currently no way to use trunk USC to test staging services (eg. the latest recommender).

To post a comment you must log in.
2846. By Anthony Lenton

Put back run_against_rnr_testing_env.sh.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/enums.py'
2--- softwarecenter/enums.py 2012-03-06 20:22:15 +0000
3+++ softwarecenter/enums.py 2012-03-13 18:51:22 +0000
4@@ -38,11 +38,11 @@
5 RECOMMENDER_HOST = os.environ.get("SOFTWARE_CENTER_RECOMMENDER_HOST") or "https://rec.ubuntu.com"
6 #RECOMMENDER_HOST = os.environ.get("SOFTWARE_CENTER_RECOMMENDER_HOST") or "https://rec.staging.ubuntu.com"
7
8-# for the sso login
9+# for the sso login. ussoc expects the USSOC_SERVICE_URL environment variable
10+# to be a full path to the service root (including /api/1.0), not just the
11+# hostname, so we use the same convention for UBUNTU_SSO_SERVICE:
12 UBUNTU_SSO_SERVICE = os.environ.get(
13- "USSOC_SERVICE_URL", "https://login.ubuntu.com/")
14-SSO_LOGIN_HOST = UBUNTU_SSO_SERVICE
15-
16+ "USSOC_SERVICE_URL", "https://login.ubuntu.com/api/1.0")
17
18 # version of the database, every time something gets added (like
19 # terms for mime-type) increase this (but keep as a string!)
20
21=== modified file 'utils/piston-helpers/piston_generic_helper.py'
22--- utils/piston-helpers/piston_generic_helper.py 2012-02-12 22:30:21 +0000
23+++ utils/piston-helpers/piston_generic_helper.py 2012-03-13 18:51:22 +0000
24@@ -59,8 +59,9 @@
25 from softwarecenter.backend.piston.sreclient_pristine import SoftwareCenterRecommenderAPI
26
27 # patch default_service_root to the one we use
28-from softwarecenter.enums import SSO_LOGIN_HOST
29-UbuntuSsoAPI.default_service_root = SSO_LOGIN_HOST+"/api/1.0"
30+from softwarecenter.enums import UBUNTU_SSO_SERVICE
31+# *Don't* append /api/1.0, as it's already included in UBUNTU_SSO_SERVICE
32+UbuntuSsoAPI.default_service_root = UBUNTU_SSO_SERVICE
33
34 from softwarecenter.enums import RECOMMENDER_HOST
35 SoftwareCenterRecommenderAPI.default_service_root = RECOMMENDER_HOST+"/api/1.0"