Lint BuildManager
This commit is contained in:
parent
043a30ee96
commit
6df6f28edf
9 changed files with 187 additions and 173 deletions
|
@ -8,7 +8,6 @@ class BuildJobLoadException(Exception):
|
|||
|
||||
class BuildJob(object):
|
||||
""" Represents a single in-progress build job. """
|
||||
|
||||
def __init__(self, job_item):
|
||||
self._job_item = job_item
|
||||
|
||||
|
@ -16,7 +15,8 @@ class BuildJob(object):
|
|||
self._job_details = json.loads(job_item.body)
|
||||
except ValueError:
|
||||
raise BuildJobLoadException(
|
||||
'Could not parse build queue item config with ID %s' % self._job_details['build_uuid'])
|
||||
'Could not parse build queue item config with ID %s' % self._job_details['build_uuid']
|
||||
)
|
||||
|
||||
try:
|
||||
self._repo_build = model.get_repository_build(self._job_details['namespace'],
|
||||
|
@ -24,13 +24,14 @@ class BuildJob(object):
|
|||
self._job_details['build_uuid'])
|
||||
except model.InvalidRepositoryBuildException:
|
||||
raise BuildJobLoadException(
|
||||
'Could not load repository build with ID %s' % self._job_details['build_uuid'])
|
||||
'Could not load repository build with ID %s' % self._job_details['build_uuid'])
|
||||
|
||||
try:
|
||||
self._build_config = json.loads(self._repo_build.job_config)
|
||||
except ValueError:
|
||||
raise BuildJobLoadException(
|
||||
'Could not parse repository build job config with ID %s' % self._job_details['build_uuid'])
|
||||
'Could not parse repository build job config with ID %s' % self._job_details['build_uuid']
|
||||
)
|
||||
|
||||
def determine_cached_tag(self):
|
||||
""" Returns the tag to pull to prime the cache or None if none. """
|
||||
|
@ -56,4 +57,4 @@ class BuildJob(object):
|
|||
|
||||
def build_config(self):
|
||||
""" Returns the parsed repository build config for the job. """
|
||||
return self._build_config
|
||||
return self._build_config
|
||||
|
|
Reference in a new issue