From 50aaece463d358a74d9a3205d0a291b9f9c156b8 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Sat, 13 Apr 2013 10:12:45 -0500 Subject: [PATCH] misc: Use pythonic 'is not None' for jobid case The conditional 'if global_jobid:' evaluates to true in some cases even when global_jobid is None. Signed-off-by: Sam Lang --- teuthology/misc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 4c92f63ca96dd..d49031c628163 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -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, -- 2.39.5