]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
misc: Use pythonic 'is not None' for jobid case
authorSam Lang <sam.lang@inktank.com>
Sat, 13 Apr 2013 15:12:45 +0000 (10:12 -0500)
committerSam Lang <sam.lang@inktank.com>
Sat, 13 Apr 2013 15:12:45 +0000 (10:12 -0500)
The conditional 'if global_jobid:' evaluates to true
in some cases even when global_jobid is None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
teuthology/misc.py

index 4c92f63ca96dd63565541fb559bce371aa1d5498..d49031c6281631a161d7b50cfe5b89a2d81af3f9 100644 (file)
@@ -46,13 +46,14 @@ def get_testdir(ctx):
             # same job id on all machines, use that as the test subdir
             (jobid,) = jobids.iterkeys()
             global_jobid = jobid
+            log.debug('setting my jobid to {jid}'.format(jid=global_jobid))
         checked_jobid = True
 
     # the subdir is chosen using the priority:
     # 1. jobid chosen by the teuthology beanstalk queue
     # 2. run name specified by teuthology schedule
     # 3. user@timestamp
-    if global_jobid:
+    if global_jobid is not None:
         log.debug('with jobid basedir: {b}'.format(b=str(global_jobid)))
         return '{basedir}/{jobid}'.format(
                     basedir=basedir,