import argparse
import contextlib
import logging
-from cStringIO import StringIO
from teuthology import misc as teuthology
from teuthology import contextutil
def get_toxvenv_dir(ctx):
return ctx.tox.venv_path
-def run_in_tox_venv(ctx, remote, args, **kwargs):
- return remote.run(
- args=[ 'source', '{}/bin/activate'.format(get_toxvenv_dir(ctx)), run.Raw('&&') ] + args,
- **kwargs
- )
+def toxvenv_sh(ctx, remote, args, **kwargs):
+ activate = get_toxvenv_dir(ctx) + '/bin/activate'
+ return remote.sh(['source', activate, run.Raw('&&')] + args, **kwargs)
def run_in_keystone_venv(ctx, client, args):
run_in_keystone_dir(ctx, client,
for (client, _) in config.items():
(remote,) = ctx.cluster.only(client).remotes.keys()
# use bindep to read which dependencies we need from keystone/bindep.txt
- run_in_tox_venv(ctx, remote, ['pip', 'install', 'bindep'])
- r = run_in_tox_venv(ctx, remote,
+ toxvenv_sh(ctx, remote, ['pip', 'install', 'bindep'])
+ packages[client] = toxvenv_sh(ctx, remote,
['bindep', '--brief', '--file', '{}/bindep.txt'.format(get_keystone_dir(ctx))],
- stdout=StringIO(),
- check_status=False) # returns 1 on success?
- packages[client] = r.stdout.getvalue().splitlines()
+ check_status=False).splitlines() # returns 1 on success?
for dep in packages[client]:
install_package(dep, remote)
try: