]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
schedule: priority option
authorSage Weil <sage@inktank.com>
Fri, 27 Sep 2013 18:57:55 +0000 (11:57 -0700)
committerSage Weil <sage@inktank.com>
Fri, 27 Sep 2013 18:57:55 +0000 (11:57 -0700)
Default to 1000.  Note that beanstalk priority is 2^31, so this
won't mix well with older code scheduling things at the
beanstalk default priority.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/run.py

index 36a48cb9056825483701f3f906d3219ccc5b790f..b343b5fcc280511bf7f2d34bf0ecb98d62055c57 100644 (file)
@@ -305,6 +305,12 @@ def schedule():
         type=int,
         help='number of times to run/queue the job'
         )
+    parser.add_argument(
+        '-p', '--priority',
+        default=1000,
+        type=int,
+        help='beanstalk priority (lower is sooner)'
+        )
     parser.add_argument(
         '-v', '--verbose',
         action='store_true',
@@ -379,6 +385,10 @@ def schedule():
     job = yaml.safe_dump(job_config)
     num = ctx.num
     while num > 0:
-        jid = beanstalk.put(job, ttr=60*60*24)
+        jid = beanstalk.put(
+            job,
+            ttr=60*60*24,
+            priority=ctx.priority,
+            )
         print 'Job scheduled with ID {jid}'.format(jid=jid)
         num -= 1