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
=== modified file 'fabtasks/bootstrap.py'
--- fabtasks/bootstrap.py 2011-04-11 09:28:12 +0000
+++ fabtasks/bootstrap.py 2011-05-06 21:01:45 +0000
@@ -17,6 +17,7 @@
1717
18import os18import os
19import os.path19import os.path
20import sys
2021
21from fabric.api import local22from fabric.api import local
2223
@@ -33,15 +34,18 @@
3334
3435
35def symlink_python_apt():36def symlink_python_apt():
36 _symlink(37 version_minor = sys.version_info[1]
37 '/usr/lib/python2.6/dist-packages/apt/',38 system_libdir = '/usr/lib/python2.%s/' % version_minor
38 'virtualenv/lib/python2.6/site-packages/apt')39 virtualenv_libdir = 'virtualenv/lib/python2.%s/' % version_minor
39 _symlink(40 _symlink(
40 '/usr/lib/python2.6/dist-packages/apt_pkg.so',41 system_libdir + 'dist-packages/apt/',
41 'virtualenv/lib/python2.6/site-packages/apt_pkg.so')42 virtualenv_libdir + 'site-packages/apt')
42 _symlink(43 _symlink(
43 '/usr/lib/python2.6/dist-packages/apt_inst.so',44 system_libdir + 'dist-packages/apt_pkg.so',
44 'virtualenv/lib/python2.6/site-packages/apt_inst.so')45 virtualenv_libdir + 'site-packages/apt_pkg.so')
46 _symlink(
47 system_libdir + 'dist-packages/apt_inst.so',
48 virtualenv_libdir + 'site-packages/apt_inst.so')
4549
4650
47def _symlink(source, link_name):51def _symlink(source, link_name):

Subscribers

People subscribed via source and target branches