From 65f49beb3520d78e483d10a4f231d4c728e3912e Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 19 Jul 2013 08:59:53 -0400 Subject: [PATCH 1/2] safer get by falling back to a dictionary --- teuthology/queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/queue.py b/teuthology/queue.py index d0ad70a09a8..3a308899d37 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -81,7 +81,7 @@ describe. One job is run at a time. log.debug('Config is: %s', job.body) job_config = yaml.safe_load(job.body) safe_archive = safepath.munge(job_config['name']) - teuthology_branch=job_config.get('config').get('teuthology_branch', 'master') + teuthology_branch = job_config.get('config', {}).get('teuthology_branch', 'master') teuth_path = os.path.join(os.getenv("HOME"), 'teuthology-' + teuthology_branch, 'virtualenv', 'bin') if not os.path.isdir(teuth_path): From 5263a6f7584e83182e12546d677cf18e7cb1007f Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 19 Jul 2013 09:01:28 -0400 Subject: [PATCH 2/2] failed dict.get evaluates to None --- teuthology/queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/queue.py b/teuthology/queue.py index 3a308899d37..8ff69cacd3a 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -86,7 +86,7 @@ describe. One job is run at a time. teuth_path = os.path.join(os.getenv("HOME"), 'teuthology-' + teuthology_branch, 'virtualenv', 'bin') if not os.path.isdir(teuth_path): raise Exception('Teuthology branch ' + teuthology_branch + ' not found at ' + teuth_path) - if job_config.get('last_in_suite', False): + if job_config.get('last_in_suite'): log.debug('Generating coverage for %s', job_config['name']) args = [ os.path.join(teuth_path, 'teuthology-results'),