From 61ec06bbad6e4b7f683d2f11dd74669e57ff65c3 Mon Sep 17 00:00:00 2001 From: Shraddha Agrawal Date: Tue, 25 Aug 2020 23:38:09 +0530 Subject: [PATCH] fixes Signed-off-by: Shraddha Agrawal --- docs/commands/teuthology-dispatcher.rst | 4 ++++ scripts/dispatcher.py | 10 +++++----- teuthology/misc.py | 22 ++++------------------ 3 files changed, 13 insertions(+), 23 deletions(-) create mode 100644 docs/commands/teuthology-dispatcher.rst diff --git a/docs/commands/teuthology-dispatcher.rst b/docs/commands/teuthology-dispatcher.rst new file mode 100644 index 0000000000..787ba86e7f --- /dev/null +++ b/docs/commands/teuthology-dispatcher.rst @@ -0,0 +1,4 @@ +teuthology-dispatcher +=============== + +.. program-output:: teuthology-dispatcher --help \ No newline at end of file diff --git a/scripts/dispatcher.py b/scripts/dispatcher.py index db24636964..5c65d8a401 100644 --- a/scripts/dispatcher.py +++ b/scripts/dispatcher.py @@ -1,7 +1,7 @@ """ 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 @@ -17,10 +17,10 @@ standard arguments: -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 diff --git a/teuthology/misc.py b/teuthology/misc.py index 8cd7070653..0b3547d6b2 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -1370,10 +1370,10 @@ def archive_logs(ctx, remote_path, log_path): 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: @@ -1387,22 +1387,8 @@ def compress_logs(ctx, remote_dir): 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, ), ) -- 2.39.5