"""
usage: teuthology-dispatcher --help
- teuthology-dispatcher --supervisor [-v] --bin-path BIN_PATH --job-config COFNFIG --archive-dir ARC_DIR
- teuthology-dispatcher [-v] --archive-dir ARC_DIR --log-dir LOG_DIR --tube TUBE
+ teuthology-dispatcher --supervisor [-v] --bin-path BIN_PATH --job-config COFNFIG --archive-dir DIR
+ teuthology-dispatcher [-v] --archive-dir DIR --log-dir LOG_DIR --tube TUBE
Start a dispatcher for the specified tube. Grab jobs from a beanstalk
queue and run the teuthology tests they describe as subprocesses. The
-v, --verbose be more verbose
-t, --tube TUBE which beanstalk tube to read jobs from
-l, --log-dir LOG_DIR path in which to store logs
- --archive-dir ARC_DIR path to archive results in
- --supervisor run dispactcher in job supervisor mode
+ -a DIR, --archive-dir DIR path to archive results in
+ --supervisor run dispatcher in job supervisor mode
--bin-path BIN_PATH teuthology bin path
- --job-config CONFIG file descriptor of job's config file
+ --job-config CONFIG file descriptor of job's config file
"""
import docopt
remote_path dir to job's archive dir under log_path dir.
"""
path = os.path.join(ctx.archive, 'remote')
- os.mkdirs(path, exist_ok=True)
+ os.makedirs(path, exist_ok=True)
for remote in ctx.cluster.remotes.keys():
sub = os.path.join(path, remote.shortname)
- os.mkdirs(sub, exist_ok=True)
+ os.makedirs(sub, exist_ok=True)
try:
pull_directory(remote, remote_path, os.path.join(sub, log_path))
except ReadError:
log.info('Compressing logs...')
run.wait(
ctx.cluster.run(
- args=[
- 'sudo',
- 'find',
- remote_dir,
- '-name',
- '*.log',
- '-print0',
- run.Raw('|'),
- 'sudo',
- 'xargs',
- '-0',
- '--no-run-if-empty',
- '--',
- 'gzip',
- '--',
- ],
+ args=(f"sudo find {remote_dir} -name *.log -print0 | "
+ f"sudo xargs -0 --no-run-if-empty -- gzip --"),
wait=False,
),
)