diff options
author | Oliver Chang <oliverchang@users.noreply.github.com> | 2021-08-27 07:28:30 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 21:28:30 +0000 |
commit | 8c28dd7e0e0909aff9764972398f134218dd11bc (patch) | |
tree | 7689e61965dbe1b8db345f7b179eeb0ae973ba0f /infra | |
parent | 71a9130e3ead1f43e043dce3f8f056d33f57a334 (diff) | |
download | oss-fuzz-8c28dd7e0e0909aff9764972398f134218dd11bc.tar.gz |
Fix exception in build. (#6323)
Have build_project.Project() take in project.yaml contents and parse
that.
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/build/functions/build_project.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/infra/build/functions/build_project.py b/infra/build/functions/build_project.py index bd9c35847..c3656d49e 100755 --- a/infra/build/functions/build_project.py +++ b/infra/build/functions/build_project.py @@ -95,14 +95,15 @@ def get_project_data(project_name): raise project_yaml_path = os.path.join(project_dir, 'project.yaml') with open(project_yaml_path, 'r') as project_yaml_file_handle: - project_yaml = yaml.safe_load(project_yaml_file_handle) - return project_yaml, dockerfile + project_yaml_contents = project_yaml_file_handle.read() + return project_yaml_contents, dockerfile class Project: # pylint: disable=too-many-instance-attributes """Class representing an OSS-Fuzz project.""" - def __init__(self, name, project_yaml, dockerfile, image_project): + def __init__(self, name, project_yaml_contents, dockerfile, image_project): + project_yaml = yaml.safe_load(project_yaml_contents) self.name = name self.image_project = image_project self.workdir = workdir_from_dockerfile(dockerfile) @@ -243,11 +244,12 @@ def get_id(step_type, build): def get_build_steps( # pylint: disable=too-many-locals, too-many-statements, too-many-branches, too-many-arguments - project_name, project_yaml, dockerfile, image_project, base_images_project, - config): + project_name, project_yaml_contents, dockerfile, image_project, + base_images_project, config): """Returns build steps for project.""" - project = Project(project_name, project_yaml, dockerfile, image_project) + project = Project(project_name, project_yaml_contents, dockerfile, + image_project) if project.disabled: logging.info('Project "%s" is disabled.', project.name) |