Merge lp:~cprov/adt-cloud-worker/die-py2-die into lp:adt-cloud-worker

Proposed by Celso Providelo
Status: Merged
Merged at revision: 12
Proposed branch: lp:~cprov/adt-cloud-worker/die-py2-die
Merge into: lp:adt-cloud-worker
Diff against target: 48 lines (+10/-3)
3 files modified
README.rst (+4/-0)
adt_cloud_worker/__init__.py (+3/-2)
requirements.txt (+3/-1)
To merge this branch: bzr merge lp:~cprov/adt-cloud-worker/die-py2-die
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+251848@code.launchpad.net

Description of the change

Several tweaks that definitely break py2 support:

Adding missing python-keystoneclient for dealing with 2.0 swift API
Adding missing test_requirements.txt (mentioned in the doc).
Reading tarball as binary before swift upload, py3 is less tolerant to stupidness.

The main reason for doing that is the fact that `python-configparser` (a brute-force py2 backport of the py3 configparser module) breaks `virtualenv -p python3`, i.e., we can't have both working with the same codebase. So die py2 die ...

The charm has to be fixed to support installing deps from pip before it lands on trunk.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM, but will conflict with trunk, where test_requirements.txt has already been added.

review: Approve
13. By Celso Providelo

merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.rst'
2--- README.rst 2015-03-04 20:20:21 +0000
3+++ README.rst 2015-03-05 01:24:28 +0000
4@@ -16,6 +16,10 @@
5 Install the Service
6 ========================
7
8+Install system dependencies::
9+
10+ $ sudo apt-get install python3-dev
11+
12 Build and activate a virtualenv with python3::
13
14 $ virtualenv -p python3 --system-site-packages ve
15
16=== modified file 'adt_cloud_worker/__init__.py'
17--- adt_cloud_worker/__init__.py 2015-03-04 20:20:21 +0000
18+++ adt_cloud_worker/__init__.py 2015-03-05 01:24:28 +0000
19@@ -72,7 +72,8 @@
20 # Run `adt-run`.
21 adt_kwargs = body.copy()
22 adt_kwargs['result_dir'] = result_dir
23- adt_kwargs['nova_extra_args'] = self.config.get('nova', 'extra_args').split()
24+ adt_kwargs['nova_extra_args'] = self.config.get(
25+ 'nova', 'extra_args').split()
26 arguments = _make_adt_argument_list(adt_kwargs)
27
28 body['exit_code'] = run_adt(arguments)
29@@ -96,7 +97,7 @@
30 or '2.0'))
31 container_name = 'adt-{}'.format(body['request_id'])
32 swift_client.put_container(container_name)
33- with open(tarball_path) as fd:
34+ with open(tarball_path, 'rb') as fd:
35 swift_client.put_object(
36 container_name, obj='results.tgz.tmp', contents=fd,
37 content_type='application/x-compressed')
38
39=== modified file 'requirements.txt'
40--- requirements.txt 2015-03-04 19:28:28 +0000
41+++ requirements.txt 2015-03-05 01:24:28 +0000
42@@ -1,2 +1,4 @@
43+python-keystoneclient==1.2.0
44 python-swiftclient==2.3.1
45-kombu==3.0.24
46\ No newline at end of file
47+kombu==3.0.24
48+

Subscribers

People subscribed via source and target branches