Handle build_set being None for priority

There are flows where there is no build_set. In those cases, return
a normal priority.

Also fixes a pep8 error from a force-merge.

Change-Id: I1c98508fe227f7f6aa1d0b2f7dcf270cecaa60d8
This commit is contained in:
Monty Taylor 2017-09-29 19:12:52 -05:00
parent 68d3ba566c
commit b58820536f
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 6 additions and 2 deletions

View File

@ -486,7 +486,7 @@ class JobParser(object):
job = model.Job(conf['name'])
job.source_context = conf.get('_source_context')
job.source_line = conf.get('_start_mark').line +1
job.source_line = conf.get('_start_mark').line + 1
is_variant = layout.hasJob(conf['name'])
if 'parent' in conf:

View File

@ -532,7 +532,11 @@ class NodeRequest(object):
@property
def priority(self):
return PRIORITY_MAP[self.build_set.item.pipeline.precedence]
if self.build_set:
precedence = self.build_set.item.pipeline.precedence
else:
precedence = PRECEDENCE_NORMAL
return PRIORITY_MAP[precedence]
@property
def fulfilled(self):