--- /dev/null
+import argparse
+
+import teuthology.queue
+
+
+def main():
+ teuthology.queue.worker(parse_args())
+
+
+def parse_args():
+ parser = argparse.ArgumentParser(description="""
+Grab jobs from a beanstalk queue and run the teuthology tests they
+describe. One job is run at a time.
+""")
+ parser.add_argument(
+ '-v', '--verbose',
+ action='store_true', default=None,
+ help='be more verbose',
+ )
+ parser.add_argument(
+ '--archive-dir',
+ metavar='DIR',
+ help='path under which to archive results',
+ required=True,
+ )
+ parser.add_argument(
+ '-l', '--log-dir',
+ help='path in which to store logs',
+ required=True,
+ )
+ parser.add_argument(
+ '-t', '--tube',
+ help='which beanstalk tube to read jobs from',
+ required=True,
+ )
+
+ return parser.parse_args()
'teuthology-nuke = scripts.nuke:main',
'teuthology-suite = scripts.suite:main',
'teuthology-ls = scripts.ls:main',
- 'teuthology-worker = teuthology.queue:worker',
+ 'teuthology-worker = scripts.worker:main',
'teuthology-lock = teuthology.lock:main',
'teuthology-schedule = teuthology.run:schedule',
'teuthology-updatekeys = teuthology.lock:update_hostkeys',
finally:
lock.release()
-def worker():
- parser = argparse.ArgumentParser(description="""
-Grab jobs from a beanstalk queue and run the teuthology tests they
-describe. One job is run at a time.
-""")
- parser.add_argument(
- '-v', '--verbose',
- action='store_true', default=None,
- help='be more verbose',
- )
- parser.add_argument(
- '--archive-dir',
- metavar='DIR',
- help='path under which to archive results',
- required=True,
- )
- parser.add_argument(
- '-l', '--log-dir',
- help='path in which to store logs',
- required=True,
- )
- parser.add_argument(
- '-t', '--tube',
- help='which beanstalk tube to read jobs from',
- required=True,
- )
-
- ctx = parser.parse_args()
-
+def worker(ctx):
loglevel = logging.INFO
if ctx.verbose:
loglevel = logging.DEBUG