← Back to team overview

launchpad-dev team mailing list archive

Problems with utilities/ec2 test -s "..." on Jaunty (and possibly on Karmic too)?

 

The workaround:

  $ cd <your branch>
  $ PYTHONPATH=lib python -c \
      'from devscripts.ec2test.entrypoint import main; main()' \
      test -s "..."

The explanation:

A prominent Launchpad developer - who does not wish to be named
because he's still on Jaunty - reported some problems with using
utilities/ec2 recently. A change had landed that made this script use
the buildout managed libs and changed the interpreter to python2.4.

However, he now gets an error about not being able to import
bzrlib.plugins.pqm.pqm_submit:

  Traceback (most recent call last):
    File "./utilities/ec2", line 12, in ?
      from devscripts.ec2test.entrypoint import main
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/entrypoint.py", line 17, in ?
      from devscripts.ec2test import builtins
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/builtins.py", line 27, in ?
      from devscripts.ec2test.testrunner import EC2TestRunner, TRUNK_BRANCH
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/testrunner.py", line 21, in ?
      from bzrlib.plugins.pqm.pqm_submit import (
  ImportError: No module named pqm.pqm_submit

This is because the bzrlib managed by buildout is masking the system
installed bzr-pqm. One way round this is to install the pqm plugin
into ~/.bazaar/plugins/pqm, but this caused another error on his
Jaunty machine:

  Traceback (most recent call last):
    File "./utilities/ec2", line 13, in ?
      main()
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/entrypoint.py", line 43, in main
      controller.run(args)
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/controller.py", line 145, in run
      run_bzr(argv)
    File "/home/tom/canonical/lp-sourcedeps/eggs/bzr-2.0.0_lp_1-py2.4-linux-i686.egg/bzrlib/commands.py", line 1037, in run_bzr
      ret = run(*run_argv)
    File "/home/tom/canonical/lp-sourcedeps/eggs/bzr-2.0.0_lp_1-py2.4-linux-i686.egg/bzrlib/commands.py", line 654, in run_argv_aliases
      return self.run(**all_cmd_args)
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/builtins.py", line 293, in run
      instance = EC2Instance.make(
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/instance.py", line 209, in make
      account = credentials.connect(name)
    File "/home/tom/canonical/lp-branches/trunk/lib/devscripts/ec2test/credentials.py", line 63, in connect
      conn = boto.connect_ec2(self.identifier, self.secret)
    File "/var/lib/python-support/python2.4/boto/__init__.py", line 94, in connect_ec2
      from boto.ec2.connection import EC2Connection
    File "/var/lib/python-support/python2.4/boto/ec2/connection.py", line 31, in ?
      from boto.connection import AWSQueryConnection
    File "/var/lib/python-support/python2.4/boto/connection.py", line 44, in ?
      import hashlib
  ImportError: No module named hashlib

From previous attempts at using python2.4 with boto (via
devscripts.ec2test), I know that trying to resolve this leads down a
short rabbit hole with the conclusion that boto needs python2.5 or
later on Jaunty. The boto README states:

  Efforts are made to keep boto compatible with Python 2.4.x but no
  guarantees are made.

The version on Jaunty is 1.5b at present. The version on Karmic is
1.8d, which currently does seem to be compatible with python2.4, but
it's not guaranteed to stay that way (and it may not be compatible for
all operations).

I think this is the current state of things:

 * You're probably fine on Karmic: bzrlib.plugin.load_plugins seems
   able to find the bzr-pqm plugin as long as it's either in
   ~/.bazaar/plugins or a system path.

 * On Jaunty this does not seem to be the case, and bzr-pqm needs to
   be installed into ~/.bazaar/plugins:

     bzr branch lp:bzr-pqm ~/.bazaar/plugins/pqm

 * Either way, it's probably better to bypass the utilities/ec2 test
   script altogether for now using the workaround at the top. It's not
   worth fixing utilities/ec2 because:

 * Launchpad has been made to run on python2.5 and may be running on
   python2.6 by the end of the week. Once that work has landed this
   will cease to be an issue.

Gavin.



Follow ups