Merge lp:~mikemc/ubuntuone-storage-protocol/fix-1025950-cert-locs into lp:ubuntuone-storage-protocol
Proposed by
Mike McCracken
Status: | Merged |
---|---|
Approved by: | Alejandro J. Cura |
Approved revision: | 161 |
Merged at revision: | 154 |
Proposed branch: | lp:~mikemc/ubuntuone-storage-protocol/fix-1025950-cert-locs |
Merge into: | lp:ubuntuone-storage-protocol |
Prerequisite: | lp:~mikemc/ubuntuone-storage-protocol/fix-run-tests |
Diff against target: |
146 lines (+73/-23) 3 files modified
setup.py (+2/-2) tests/test_context.py (+44/-0) ubuntuone/storageprotocol/context.py (+27/-21) |
To merge this branch: | bzr merge lp:~mikemc/ubuntuone-storage-protocol/fix-1025950-cert-locs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alejandro J. Cura (community) | Approve | ||
dobey (community) | Approve | ||
Review via email: mp+118603@code.launchpad.net |
Commit message
- Add support for finding SSL certs in packaged mac app. (LP: #1025950)
Description of the change
- Add support for finding SSL certs in packaged mac app. (LP: #1025950)
This branch also adds tests for the ssl cert path finding code for windows and linux.
Tested on all three.
TO TEST:
1. run-tests or run-tests.bat
2. on darwin, use setup-mac.py to create a packaged mac app and run it from command line using something like this:
% U1_DEBUG=1 dist/ubuntuone-
Look for any errors regarding the certs path -- there should be none.
(Prior to this branch, you would see something about /etc/ssl/certs not existing)
To post a comment you must log in.
153 + if sys.platform == "win32": ConnectRegistry (None, _winreg. HKEY_LOCAL_ MACHINE) OpenKey( hive, str( \Microsoft\ \Windows\ \CurrentVersion " QueryInfoKey( key)[1] ): EnumValue( key, i) storageprotocol ")
154 + # First open the registry hive
155 + hive = _winreg.
156 + # Open the registry key where Windows stores the Shell Folder locations
157 + key = _winreg.
158 + "Software\
159 + "\\Explorer\\Shell Folders"))
160 +
161 + ssl_cert_location = None
162 + for i in range(0, _winreg.
163 + name, value, val_type = _winreg.
164 + # Common AppData will always be present unless the user
165 + # played with regedit
166 + if name == "Common AppData":
167 + ssl_cert_location = os.path.join(value,
168 + "ubuntuone-
169 + break
Instead of duplicating all this registry poking code, would it not be better here to use the load_config_ paths() [0] value from dirspec.basedir, as it already pokes at the registry to find the standard paths?