Merge lp:~mikemc/ubuntuone-storage-protocol/darwin-certs into lp:ubuntuone-storage-protocol

Proposed by Mike McCracken
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~mikemc/ubuntuone-storage-protocol/darwin-certs
Merge into: lp:ubuntuone-storage-protocol
Diff against target: 20 lines (+4/-0)
1 file modified
ubuntuone/storageprotocol/context.py (+4/-0)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-storage-protocol/darwin-certs
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
Review via email: mp+115599@code.launchpad.net

Commit message

- Use XDG_DATA_HOME to store SSL certs on darwin. (LP: #1025950)

Description of the change

- Use XDG_DATA_HOME to store SSL certs on darwin. (LP: #1025950)

This is similar in spirit to the windows solution, but uses dirspec instead of registry entries.

There don't appear to be relevant tests, but I have verified that this works in the packaged app.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

We shouldn't be using the _HOME variables for this, and you can just import "xdg_data_home" for example, if you need to use that variable.

review: Disapprove

Unmerged revisions

152. By Mike McCracken

Use dirspec get_xdg_data_home to find path to certificates on darwin

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/storageprotocol/context.py'
2--- ubuntuone/storageprotocol/context.py 2012-06-12 16:32:06 +0000
3+++ ubuntuone/storageprotocol/context.py 2012-07-18 18:03:37 +0000
4@@ -36,6 +36,8 @@
5 from twisted.internet import error, ssl
6 from twisted.python import log
7
8+from dirspec.basedir import get_xdg_data_home
9+
10 if sys.platform == "win32":
11 # diable pylint warning, as it may be the wrong platform
12 # pylint: disable=F0401
13@@ -55,6 +57,8 @@
14 ssl_cert_location = os.path.join(value,
15 "ubuntuone-storageprotocol")
16 break
17+elif sys.platform == "darwin":
18+ ssl_cert_location = get_xdg_data_home()
19 else:
20 ssl_cert_location = '/etc/ssl/certs'
21

Subscribers

People subscribed via source and target branches