]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
fixes
authorShraddha Agrawal <shraddha.agrawal000@gmail.com>
Tue, 25 Aug 2020 18:08:09 +0000 (23:38 +0530)
committerShraddha Agrawal <shraddha.agrawal000@gmail.com>
Tue, 25 Aug 2020 19:46:54 +0000 (01:16 +0530)
Signed-off-by: Shraddha Agrawal <shraddha.agrawal000@gmail.com>
docs/commands/teuthology-dispatcher.rst [new file with mode: 0644]
scripts/dispatcher.py
teuthology/misc.py

diff --git a/docs/commands/teuthology-dispatcher.rst b/docs/commands/teuthology-dispatcher.rst
new file mode 100644 (file)
index 0000000..787ba86
--- /dev/null
@@ -0,0 +1,4 @@
+teuthology-dispatcher
+===============
+
+.. program-output:: teuthology-dispatcher --help
\ No newline at end of file
index db24636964b45f968c96c42921e39826f4fb550d..5c65d8a401fb3125cb750251c4e13370ae4dc686 100644 (file)
@@ -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
index 8cd7070653d0f71cd734fe3afb77585931a3be26..0b3547d6b227aa413034d21db2f5d8649b6ad47e 100644 (file)
@@ -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,
         ),
     )