Merge lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal into lp:ubuntuone-storage-protocol

Proposed by Brian Curtin
Status: Merged
Approved by: Brian Curtin
Approved revision: 169
Merged at revision: 160
Proposed branch: lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal
Merge into: lp:ubuntuone-storage-protocol
Diff against target: 265 lines (+6/-153)
8 files modified
MANIFEST.in (+0/-1)
data/UbuntuOne-Go_Daddy_CA.pem (+0/-29)
data/UbuntuOne-Go_Daddy_Class_2_CA.pem (+0/-25)
data/UbuntuOne-ValiCert_Class_2_VA.pem (+0/-18)
run-tests.bat (+1/-1)
setup.py (+0/-6)
tests/test_context.py (+3/-45)
ubuntuone/storageprotocol/context.py (+2/-28)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal
Reviewer Review Type Date Requested Status
dobey (community) Approve
Mike McCracken (community) Approve
Review via email: mp+165232@code.launchpad.net

Commit message

- Remove get_cert_location because it is now implemented as get_cert_dir in ubuntu-sso-client

Description of the change

Now that get_cert_dir is implemented in ubuntu-sso-client, remove its implementation and tests from storageprotocol.

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

minor lint stuff:
== Python Lint Notices ==

/Users/mmccrack/Documents/Canonical/Source/test-improve-buildout/scripts/devsetup/parts/ubuntuone-storage-protocol/tests/test_context.py:
    31: 'sys' imported but unused

/Users/mmccrack/Documents/Canonical/Source/test-improve-buildout/scripts/devsetup/parts/ubuntuone-storage-protocol/ubuntuone/storageprotocol/context.py:
    33: 'sys' imported but unused
    39: 'load_config_paths' imported but unused

review: Needs Fixing
Revision history for this message
Mike McCracken (mikemc) :
review: Approve
Revision history for this message
dobey (dobey) wrote :

14 === modified file 'setup.py'
15 --- setup.py 2012-12-03 19:45:43 +0000
16 +++ setup.py 2013-05-22 21:39:27 +0000
17 @@ -26,7 +26,7 @@
18 from distutils.core import setup
19 from distutils.spawn import find_executable
20 from distutils.command import clean, build
21 -from ubuntuone.storageprotocol.context import get_cert_location
22 +from ubuntu_sso.utils import get_cert_dir
23
24
25 class StorageProtocolBuild(build.build):
26 @@ -74,7 +74,7 @@
27 packages=['ubuntuone',
28 'ubuntuone.storageprotocol'],
29 extra_path='ubuntuone-storage-protocol',
30 - data_files=[(get_cert_location(),
31 + data_files=[(get_cert_dir(),
32 ['data/UbuntuOne-Go_Daddy_CA.pem',
33 'data/UbuntuOne-ValiCert_Class_2_VA.pem',
34 'data/UbuntuOne-Go_Daddy_Class_2_CA.pem'])],
35

sso-client and storage-protocol can't both be installing the same files to the same place. These files will need to be removed from this tree, and not installed at all.

Revision history for this message
dobey (dobey) :
review: Needs Fixing
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

The attempt to merge lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal into lp:ubuntuone-storage-protocol failed. Below is the output from the failed tests.

running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/ubuntuone
copying ubuntuone/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone
creating build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/protocol_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/context.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/content_hash.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/proxy_tunnel.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/errors.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/sharersp.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/utils.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/volumes.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/client.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/request.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/delta.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/validators.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol

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-storage-protocol/tests/test_context.py", line 37, in <module>
    from ubuntuone.storageprotocol import context
  File "/mnt/tarmac/cache/ubuntuone-storage-protocol/ubuntuone/storageprotocol/context.py", line 38, in <module>
    from ubuntu_sso.utils import get_cert_dir
ImportError: cannot import name get_cert_dir

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (21.6 KiB)

The attempt to merge lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal into lp:ubuntuone-storage-protocol failed. Below is the output from the failed tests.

running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/ubuntuone
copying ubuntuone/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone
creating build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/protocol_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/context.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/content_hash.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/proxy_tunnel.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/errors.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/sharersp.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/utils.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/volumes.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/client.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/request.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/delta.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/validators.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
tests.test_hashes
  ContentHashingTests
    test_content_hash ... [OK]
    test_hashing_content_once ... [OK]
    test_hashing_content_upadting ... [OK]
    test_hashing_empty ... [OK]
  FactoriesTest
    test_content_hash_factory ... [OK]
    test_content_hash_method ... [OK]
    test_content_hash_method_name ... [OK]
    test_magic_hash_factory ... [OK]
    test_magic_hash_method ... [OK]
    test_magic_hash_method_name ... [OK]
  MagicHashingTests
    test_content_hash_hiding ... [OK]
    test_digest_hiding ... [OK]
    test_hashing_content_once ... [OK]
    test_hashing_content_upadting ... [OK]
    test_hashing_empty ... ...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (21.6 KiB)

The attempt to merge lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal into lp:ubuntuone-storage-protocol failed. Below is the output from the failed tests.

running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/ubuntuone
copying ubuntuone/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone
creating build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/protocol_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/context.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/content_hash.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/proxy_tunnel.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/errors.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/sharersp.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/utils.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/volumes.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/client.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/request.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/delta.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/validators.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
tests.test_hashes
  ContentHashingTests
    test_content_hash ... [OK]
    test_hashing_content_once ... [OK]
    test_hashing_content_upadting ... [OK]
    test_hashing_empty ... [OK]
  FactoriesTest
    test_content_hash_factory ... [OK]
    test_content_hash_method ... [OK]
    test_content_hash_method_name ... [OK]
    test_magic_hash_factory ... [OK]
    test_magic_hash_method ... [OK]
    test_magic_hash_method_name ... [OK]
  MagicHashingTests
    test_content_hash_hiding ... [OK]
    test_digest_hiding ... [OK]
    test_hashing_content_once ... [OK]
    test_hashing_content_upadting ... [OK]
    test_hashing_empty ... ...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (38.0 KiB)

The attempt to merge lp:~brian.curtin/ubuntuone-storage-protocol/get_cert_location-removal into lp:ubuntuone-storage-protocol failed. Below is the output from the failed tests.

running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/ubuntuone
copying ubuntuone/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone
creating build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/protocol_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/context.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/content_hash.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/proxy_tunnel.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/errors.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/sharersp.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/utils.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/volumes.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/client.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent_pb2.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/request.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/delta.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/dircontent.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
copying ubuntuone/storageprotocol/validators.py -> build/lib.linux-x86_64-2.7/ubuntuone/storageprotocol
tests.test_hashes
  ContentHashingTests
    test_content_hash ... [OK]
    test_hashing_content_once ... [OK]
    test_hashing_content_upadting ... [OK]
    test_hashing_empty ... [OK]
  FactoriesTest
    test_content_hash_factory ... [OK]
    test_content_hash_method ... [OK]
    test_content_hash_method_name ... [OK]
    test_magic_hash_factory ... [OK]
    test_magic_hash_method ... [OK]
    test_magic_hash_method_name ... [OK]
  MagicHashingTests
    test_content_hash_hiding ... [OK]
    test_digest_hiding ... [OK]
    test_hashing_content_once ... [OK]
    test_hashing_content_upadting ... [OK]
    test_hashing_empty ... ...

169. By Brian Curtin

lint...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2012-03-29 20:28:09 +0000
+++ MANIFEST.in 2013-05-28 14:43:22 +0000
@@ -4,6 +4,5 @@
4include run-tests4include run-tests
5include *.pth5include *.pth
6recursive-include ubuntuone *.proto6recursive-include ubuntuone *.proto
7recursive-include data *.pem
8recursive-include samples *.py7recursive-include samples *.py
9recursive-include tests *.py8recursive-include tests *.py
109
=== removed directory 'data'
=== removed file 'data/UbuntuOne-Go_Daddy_CA.pem'
--- data/UbuntuOne-Go_Daddy_CA.pem 2011-09-21 12:53:10 +0000
+++ data/UbuntuOne-Go_Daddy_CA.pem 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
1-----BEGIN CERTIFICATE-----
2MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVMx
3ITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g
4RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMTYw
5MTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UECBMH
6QXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWRkeS5j
7b20sIEluYy4xMzAxBgNVBAsTKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5j
8b20vcmVwb3NpdG9yeTEwMC4GA1UEAxMnR28gRGFkZHkgU2VjdXJlIENlcnRpZmlj
9YXRpb24gQXV0aG9yaXR5MREwDwYDVQQFEwgwNzk2OTI4NzCCASIwDQYJKoZIhvcN
10AQEBBQADggEPADCCAQoCggEBAMQt1RWMnCZM7DI161+4WQFapmGBWTtwY6vj3D3H
11KrjJM9N55DrtPDAjhI6zMBS2sofDPZVUBJ7fmd0LJR4h3mUpfjWoqVTr9vcyOdQm
12VZWt7/v+WIbXnvQAjYwqDL1CBM6nPwT27oDyqu9SoWlm2r4arV3aLG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17b3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj
18YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF
19BQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYX
20MP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt
21I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheab
22IZ0KbIIOqPjCDPoQHmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzr
23Tia2cyvk0/ZM/iZx4mERdEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBD
24pqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/bvZ8=
25-----END CERTIFICATE-----
260
=== removed file 'data/UbuntuOne-ValiCert_Class_2_VA.pem'
--- data/UbuntuOne-ValiCert_Class_2_VA.pem 2012-08-15 21:53:43 +0000
+++ data/UbuntuOne-ValiCert_Class_2_VA.pem 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
1-----BEGIN CERTIFICATE-----
2MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
3IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
4BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
5aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
69w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy
7NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
8azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
9YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
10Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
11cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY
12dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9
13WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS
14v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v
15UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu
16IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC
17W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd
18-----END CERTIFICATE-----
190
=== modified file 'run-tests.bat'
--- run-tests.bat 2012-08-15 18:08:39 +0000
+++ run-tests.bat 2013-05-28 14:43:22 +0000
@@ -18,7 +18,7 @@
18SET PYTHONEXEPATH=""18SET PYTHONEXEPATH=""
19SET IGNORE_PATHS="ubuntuone\controlpanel\dbustests"19SET IGNORE_PATHS="ubuntuone\controlpanel\dbustests"
20SET IGNORE_MODULES="test_linux.py, test_darwin.py"20SET IGNORE_MODULES="test_linux.py, test_darwin.py"
21SET PYTHONPATH=%PYTHONPATH%;..\ubuntuone-dev-tools\;..\dirspec;.21SET PYTHONPATH=%PYTHONPATH%;..\ubuntu-sso-client;..\ubuntuone-dev-tools\;..\dirspec;.
2222
23ECHO Checking for Python on the path23ECHO Checking for Python on the path
24:: Look for Python from buildout24:: Look for Python from buildout
2525
=== modified file 'setup.py'
--- setup.py 2012-12-03 19:45:43 +0000
+++ setup.py 2013-05-28 14:43:22 +0000
@@ -26,7 +26,6 @@
26from distutils.core import setup26from distutils.core import setup
27from distutils.spawn import find_executable27from distutils.spawn import find_executable
28from distutils.command import clean, build28from distutils.command import clean, build
29from ubuntuone.storageprotocol.context import get_cert_location
3029
3130
32class StorageProtocolBuild(build.build):31class StorageProtocolBuild(build.build):
@@ -74,11 +73,6 @@
74 packages=['ubuntuone',73 packages=['ubuntuone',
75 'ubuntuone.storageprotocol'],74 'ubuntuone.storageprotocol'],
76 extra_path='ubuntuone-storage-protocol',75 extra_path='ubuntuone-storage-protocol',
77 data_files=[(get_cert_location(),
78 ['data/UbuntuOne-Go_Daddy_CA.pem',
79 'data/UbuntuOne-ValiCert_Class_2_VA.pem',
80 'data/UbuntuOne-Go_Daddy_Class_2_CA.pem'])],
81
82 cmdclass={'build': StorageProtocolBuild,76 cmdclass={'build': StorageProtocolBuild,
83 'clean': StorageProtocolClean},77 'clean': StorageProtocolClean},
84 )78 )
8579
=== modified file 'tests/test_context.py'
--- tests/test_context.py 2012-12-03 19:45:43 +0000
+++ tests/test_context.py 2013-05-28 14:43:22 +0000
@@ -28,7 +28,6 @@
28# files in the program, then also delete it here.28# files in the program, then also delete it here.
2929
30import os30import os
31import sys
3231
33from OpenSSL import crypto, SSL32from OpenSSL import crypto, SSL
34from twisted.internet import defer, error, reactor, ssl33from twisted.internet import defer, error, reactor, ssl
@@ -36,6 +35,7 @@
36from twisted.web import client, resource, server35from twisted.web import client, resource, server
3736
38from ubuntuone.storageprotocol import context37from ubuntuone.storageprotocol import context
38from ubuntu_sso.utils import get_cert_dir
3939
4040
41class FakeCerts(object):41class FakeCerts(object):
@@ -125,7 +125,8 @@
125 def get_certificates(self):125 def get_certificates(self):
126 """Get the uninstalled certificates, for testing."""126 """Get the uninstalled certificates, for testing."""
127 certs = []127 certs = []
128 data_dir = os.path.join(os.path.dirname(__file__), os.pardir, 'data')128 data_dir = get_cert_dir()
129
129 for certname in ['UbuntuOne-Go_Daddy_Class_2_CA.pem',130 for certname in ['UbuntuOne-Go_Daddy_Class_2_CA.pem',
130 'UbuntuOne-Go_Daddy_CA.pem']:131 'UbuntuOne-Go_Daddy_CA.pem']:
131 cert_path = os.path.abspath(os.path.join(data_dir, certname))132 cert_path = os.path.abspath(os.path.join(data_dir, certname))
@@ -198,46 +199,3 @@
198 hostname="localhost")199 hostname="localhost")
199200
200 yield self.verify_context(server_context, client_context)201 yield self.verify_context(server_context, client_context)
201
202
203class SSLCertLocationTestCase(unittest.TestCase):
204 """Test determining the cert location."""
205
206 @defer.inlineCallbacks
207 def setUp(self):
208 yield super(SSLCertLocationTestCase, self).setUp()
209
210 def test_win(self):
211 """Test geting a path when Common AppData is defined."""
212 self.patch(context, "load_config_paths",
213 lambda x: [os.path.join("returned-value", x)])
214 self.patch(sys, "platform", "win32")
215 path = context.get_cert_location()
216 self.assertEqual(path, os.path.join("returned-value",
217 "ubuntuone-storageprotocol"))
218
219 def test_darwin_frozen(self):
220 """Test that we get a path with .app in it on frozen darwin."""
221 self.patch(sys, "platform", "darwin")
222 sys.frozen = "macosx-app"
223 self.addCleanup(delattr, sys, "frozen")
224 self.patch(context, "__file__",
225 os.path.join("path", "to", "Main.app", "ignore"))
226 path = context.get_cert_location()
227 self.assertEqual(path, os.path.join("path", "to", "Main.app",
228 "Contents", "Resources"))
229
230 def test_darwin_unfrozen(self):
231 """Test that we get a source-relative path on unfrozen darwin."""
232 self.patch(sys, "platform", "darwin")
233 self.patch(context, "__file__",
234 os.path.join("path", "to", "ubuntuone",
235 "storageprotocol", "context.py"))
236 path = context.get_cert_location()
237 self.assertEqual(path, os.path.join("path", "to", "data"))
238
239 def test_linux(self):
240 """Test that linux gets the right path."""
241 self.patch(sys, "platform", "linux2")
242 path = context.get_cert_location()
243 self.assertEqual(path, "/etc/ssl/certs")
244202
=== modified file 'ubuntuone/storageprotocol/context.py'
--- ubuntuone/storageprotocol/context.py 2012-08-16 19:21:06 +0000
+++ ubuntuone/storageprotocol/context.py 2013-05-28 14:43:22 +0000
@@ -30,38 +30,12 @@
30Standard Routines for working with ssl context creation30Standard Routines for working with ssl context creation
31"""31"""
32import os32import os
33import sys
3433
35from OpenSSL import SSL34from OpenSSL import SSL
36from twisted.internet import error, ssl35from twisted.internet import error, ssl
37from twisted.python import log36from twisted.python import log
3837
39from dirspec.basedir import load_config_paths38from ubuntu_sso.utils import get_cert_dir
40
41
42def get_cert_location():
43 """Return path to certificate files."""
44
45 if sys.platform == "win32":
46 ssl_cert_location = list(load_config_paths(
47 "ubuntuone-storageprotocol"))[0]
48
49 elif sys.platform == "darwin":
50 if getattr(sys, "frozen", None) is not None:
51 main_app_dir = "".join(__file__.partition(".app")[:-1])
52 main_app_resources_dir = os.path.join(main_app_dir,
53 "Contents",
54 "Resources")
55 ssl_cert_location = main_app_resources_dir
56 else:
57 pkg_dir = os.path.dirname(__file__)
58 src_tree_path = os.path.dirname(os.path.dirname(pkg_dir))
59 ssl_cert_location = os.path.join(src_tree_path,
60 "data")
61 else:
62 ssl_cert_location = '/etc/ssl/certs'
63
64 return ssl_cert_location
6539
6640
67class HostnameVerifyContextFactory(ssl.CertificateOptions):41class HostnameVerifyContextFactory(ssl.CertificateOptions):
@@ -93,7 +67,7 @@
9367
94def get_certificates():68def get_certificates():
95 """Get a list of certificate paths."""69 """Get a list of certificate paths."""
96 ssl_cert_location = get_cert_location()70 ssl_cert_location = get_cert_dir()
97 ca_file = ssl.Certificate.loadPEM(file(os.path.join(ssl_cert_location,71 ca_file = ssl.Certificate.loadPEM(file(os.path.join(ssl_cert_location,
98 'UbuntuOne-Go_Daddy_Class_2_CA.pem'), 'r').read())72 'UbuntuOne-Go_Daddy_Class_2_CA.pem'), 'r').read())
99 ca_file_2 = ssl.Certificate.loadPEM(file(os.path.join(ssl_cert_location,73 ca_file_2 = ssl.Certificate.loadPEM(file(os.path.join(ssl_cert_location,

Subscribers

People subscribed via source and target branches