Merge lp:~nataliabidart/ubuntuone-control-panel/override-urls into lp:ubuntuone-control-panel

Proposed by Natalia Bidart on 2013-08-27
Status: Merged
Approved by: Natalia Bidart on 2013-08-28
Approved revision: 407
Merged at revision: 406
Proposed branch: lp:~nataliabidart/ubuntuone-control-panel/override-urls
Merge into: lp:ubuntuone-control-panel
Diff against target: 60 lines (+14/-5)
3 files modified
ubuntuone/controlpanel/__init__.py (+5/-1)
ubuntuone/controlpanel/backend.py (+8/-3)
ubuntuone/controlpanel/gui/__init__.py (+1/-1)
To merge this branch: bzr merge lp:~nataliabidart/ubuntuone-control-panel/override-urls
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) 2013-08-27 Approve on 2013-08-28
Review via email: mp+182496@code.launchpad.net

Commit message

- Allow Ubuntu One base url to be overridden using env var.

To post a comment you must log in.
Alejandro J. Cura (alecu) wrote :

Looks good. I like the fix for the trailing /, we should apply it to all our projects.

review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :

The attempt to merge lp:~nataliabidart/ubuntuone-control-panel/override-urls into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running DBus test suite ***

Traceback (most recent call last):
  File "/usr/bin/u1trial", line 40, in <module>
    main()
  File "/usr/lib/python2.7/dist-packages/ubuntuone-dev-tools/ubuntuone/devtools/runners/__init__.py", line 277, in main
    suite = test_runner.get_suite(options)
  File "/usr/lib/python2.7/dist-packages/ubuntuone-dev-tools/ubuntuone/devtools/runners/__init__.py", line 173, in get_suite
    config['ignore-paths']))
  File "/usr/lib/python2.7/dist-packages/ubuntuone-dev-tools/ubuntuone/devtools/runners/__init__.py", line 157, in _collect_tests
    module_suite = self._load_unittest(filepath)
  File "/usr/lib/python2.7/dist-packages/ubuntuone-dev-tools/ubuntuone/devtools/runners/__init__.py", line 98, in _load_unittest
    module = __import__(modpath, None, None, [""])
  File "/mnt/tarmac/cache/ubuntuone-control-panel/trunk/ubuntuone/controlpanel/dbustests/__init__.py", line 28, in <module>
    from ubuntuone.controlpanel import dbus_service
  File "/mnt/tarmac/cache/ubuntuone-control-panel/trunk/ubuntuone/controlpanel/dbus_service.py", line 27, in <module>
    from ubuntuone.syncdaemon.interaction_interfaces import bool_str
ImportError: No module named syncdaemon.interaction_interfaces

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/__init__.py'
2--- ubuntuone/controlpanel/__init__.py 2012-11-29 19:36:53 +0000
3+++ ubuntuone/controlpanel/__init__.py 2013-08-27 23:44:10 +0000
4@@ -24,9 +24,13 @@
5
6 """
7
8+import os
9+
10 # constants
11 DBUS_BUS_NAME = "com.ubuntuone.controlpanel"
12 DBUS_PREFERENCES_PATH = "/preferences"
13 DBUS_PREFERENCES_IFACE = "com.ubuntuone.controlpanel.Preferences"
14
15-WEBSERVICE_BASE_URL = u"https://one.ubuntu.com/api/"
16+UBUNTUONE_BASE_URL = os.environ.get(
17+ 'UONE_BASE_URL', u'https://one.ubuntu.com').rstrip('/') + '/'
18+WEBSERVICE_BASE_URL = UBUNTUONE_BASE_URL + u'api/'
19
20=== modified file 'ubuntuone/controlpanel/backend.py'
21--- ubuntuone/controlpanel/backend.py 2013-02-22 19:54:41 +0000
22+++ ubuntuone/controlpanel/backend.py 2013-08-27 23:44:10 +0000
23@@ -28,7 +28,12 @@
24 DeferredLock)
25 from ubuntuone.platform.credentials import CredentialsManagementTool
26
27-from ubuntuone.controlpanel import sd_client, replication_client
28+from ubuntuone.controlpanel import (
29+ UBUNTUONE_BASE_URL,
30+ WEBSERVICE_BASE_URL,
31+ replication_client,
32+ sd_client,
33+)
34 from ubuntuone.controlpanel.logger import setup_logging, log_call
35 from ubuntuone.controlpanel.web_client import WebClient
36 from ubuntu_sso.utils.webclient.common import (
37@@ -73,8 +78,8 @@
38
39 CONTACTS_PKG = 'thunderbird-couchdb'
40
41-UBUNTUONE_FROM_OAUTH = u'https://one.ubuntu.com/api/1.0/from_oauth/'
42-UBUNTUONE_LINK = u'https://one.ubuntu.com/'
43+UBUNTUONE_FROM_OAUTH = WEBSERVICE_BASE_URL + u'1.0/from_oauth/'
44+UBUNTUONE_LINK = UBUNTUONE_BASE_URL
45
46
47 def append_path_sep(path):
48
49=== modified file 'ubuntuone/controlpanel/gui/__init__.py'
50--- ubuntuone/controlpanel/gui/__init__.py 2013-06-12 14:32:34 +0000
51+++ ubuntuone/controlpanel/gui/__init__.py 2013-08-27 23:44:10 +0000
52@@ -70,7 +70,7 @@
53
54 FILE_URI_PREFIX = u'file://'
55
56-ACCEPT_SHARES = 'https://one.ubuntu.com/files/shareoffer/%s/'
57+ACCEPT_SHARES = UBUNTUONE_LINK + u'files/shareoffer/%s/'
58 CONTACTS_LINK = UBUNTUONE_LINK
59 DASHBOARD = UBUNTUONE_LINK + u'dashboard/'
60 EDIT_ACCOUNT_LINK = UBUNTUONE_LINK + u'account/'

Subscribers

People subscribed via source and target branches