Merge lp:~elachuni/ubuntu-webcatalog/python2.7 into lp:ubuntu-webcatalog

Proposed by Anthony Lenton
Status: Merged
Merged at revision: 14
Proposed branch: lp:~elachuni/ubuntu-webcatalog/python2.7
Merge into: lp:ubuntu-webcatalog
Diff against target: 39 lines (+13/-9)
1 file modified
fabtasks/bootstrap.py (+13/-9)
To merge this branch: bzr merge lp:~elachuni/ubuntu-webcatalog/python2.7
Reviewer Review Type Date Requested Status
Michael Nelson (community) Needs Fixing
Review via email: mp+59536@code.launchpad.net

Description of the change

This branch has a fix to the bootstrap fabric task, so that it supports natty's system library layout (using python2.7) as well as maverick's python 2.6.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks Anthony, although it looks like sys.version_info is a tuple in 2.6 :/

michael@devmav:~/isd/webcat/review$ fab symlink_python_apt
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/fabric/main.py", line 424, in main
    commands[name](*args, **kwargs)
  File "/home/michael/isd/webcat/review/fabtasks/bootstrap.py", line 37, in symlink_python_apt
    system_libdir = '/usr/lib/python2.%s/' % sys.version_info.minor
AttributeError: 'tuple' object has no attribute 'minor'
michael@devmav:~/isd/webcat/review$

In [2]: sys.version_info
Out[2]: (2, 6, 6, 'final', 0)

review: Needs Fixing
14. By Anthony Lenton

Updated bootstrap fabtask to get minor version from a tuple.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'fabtasks/bootstrap.py'
2--- fabtasks/bootstrap.py 2011-04-11 09:28:12 +0000
3+++ fabtasks/bootstrap.py 2011-05-06 21:01:45 +0000
4@@ -17,6 +17,7 @@
5
6 import os
7 import os.path
8+import sys
9
10 from fabric.api import local
11
12@@ -33,15 +34,18 @@
13
14
15 def symlink_python_apt():
16- _symlink(
17- '/usr/lib/python2.6/dist-packages/apt/',
18- 'virtualenv/lib/python2.6/site-packages/apt')
19- _symlink(
20- '/usr/lib/python2.6/dist-packages/apt_pkg.so',
21- 'virtualenv/lib/python2.6/site-packages/apt_pkg.so')
22- _symlink(
23- '/usr/lib/python2.6/dist-packages/apt_inst.so',
24- 'virtualenv/lib/python2.6/site-packages/apt_inst.so')
25+ version_minor = sys.version_info[1]
26+ system_libdir = '/usr/lib/python2.%s/' % version_minor
27+ virtualenv_libdir = 'virtualenv/lib/python2.%s/' % version_minor
28+ _symlink(
29+ system_libdir + 'dist-packages/apt/',
30+ virtualenv_libdir + 'site-packages/apt')
31+ _symlink(
32+ system_libdir + 'dist-packages/apt_pkg.so',
33+ virtualenv_libdir + 'site-packages/apt_pkg.so')
34+ _symlink(
35+ system_libdir + 'dist-packages/apt_inst.so',
36+ virtualenv_libdir + 'site-packages/apt_inst.so')
37
38
39 def _symlink(source, link_name):

Subscribers

People subscribed via source and target branches