Update the queue to use blueprint.toml

Also update the output JSON to use 'blueprint' instead of 'recipe'
This commit is contained in:
Brian C. Lane 2018-03-28 13:32:18 -07:00
parent 5efeb05aa7
commit 0887bd3d95
2 changed files with 11 additions and 11 deletions

View File

@ -160,7 +160,7 @@ def start_build(cfg, yumlock, gitlock, branch, recipe_name, compose_type, test_m
f.write(commit_id) f.write(commit_id)
# Write the original recipe # Write the original recipe
recipe_path = joinpaths(results_dir, "recipe.toml") recipe_path = joinpaths(results_dir, "blueprint.toml")
with open(recipe_path, "w") as f: with open(recipe_path, "w") as f:
f.write(recipe.toml()) f.write(recipe.toml())
@ -239,7 +239,7 @@ def start_build(cfg, yumlock, gitlock, branch, recipe_name, compose_type, test_m
if test_mode > 0: if test_mode > 0:
open(joinpaths(results_dir, "TEST"), "w").write("%s" % test_mode) open(joinpaths(results_dir, "TEST"), "w").write("%s" % test_mode)
log.info("Adding %s with recipe %s output type %s to compose queue", build_id, recipe["name"], compose_type) log.info("Adding %s (%s %s) to compose queue", build_id, recipe["name"], compose_type)
os.symlink(results_dir, joinpaths(lib_dir, "queue/new/", build_id)) os.symlink(results_dir, joinpaths(lib_dir, "queue/new/", build_id))
return build_id return build_id

View File

@ -235,7 +235,7 @@ def compose_detail(results_dir):
:type results_dir: str :type results_dir: str
:returns: A dictionary with details about the compose :returns: A dictionary with details about the compose
:rtype: dict :rtype: dict
:raises: IOError if it cannot read the directory, STATUS, or recipe file. :raises: IOError if it cannot read the directory, STATUS, or blueprint file.
The following details are included in the dict: The following details are included in the dict:
@ -243,14 +243,14 @@ def compose_detail(results_dir):
* queue_status - The final status of the composition (FINISHED or FAILED) * queue_status - The final status of the composition (FINISHED or FAILED)
* timestamp - The time of the last status change * timestamp - The time of the last status change
* compose_type - The type of output generated (tar, iso, etc.) * compose_type - The type of output generated (tar, iso, etc.)
* recipe - Recipe name * blueprint - Blueprint name
* version - Recipe version * version - Blueprint version
* image_size - Size of the image, if finished. 0 otherwise. * image_size - Size of the image, if finished. 0 otherwise.
""" """
build_id = os.path.basename(os.path.abspath(results_dir)) build_id = os.path.basename(os.path.abspath(results_dir))
status = open(joinpaths(results_dir, "STATUS")).read().strip() status = open(joinpaths(results_dir, "STATUS")).read().strip()
mtime = os.stat(joinpaths(results_dir, "STATUS")).st_mtime mtime = os.stat(joinpaths(results_dir, "STATUS")).st_mtime
recipe = recipe_from_file(joinpaths(results_dir, "recipe.toml")) blueprint = recipe_from_file(joinpaths(results_dir, "blueprint.toml"))
compose_type = get_compose_type(results_dir) compose_type = get_compose_type(results_dir)
@ -264,8 +264,8 @@ def compose_detail(results_dir):
"queue_status": status, "queue_status": status,
"timestamp": mtime, "timestamp": mtime,
"compose_type": compose_type, "compose_type": compose_type,
"recipe": recipe["name"], "blueprint": blueprint["name"],
"version": recipe["version"], "version": blueprint["version"],
"image_size": image_size "image_size": image_size
} }
@ -438,8 +438,8 @@ def uuid_info(cfg, uuid):
* id - The uuid of the comoposition * id - The uuid of the comoposition
* config - containing the configuration settings used to run Anaconda * config - containing the configuration settings used to run Anaconda
* recipe - The depsolved recipe used to generate the kickstart * blueprint - The depsolved blueprint used to generate the kickstart
* commit - The (local) git commit hash for the recipe used * commit - The (local) git commit hash for the blueprint used
* deps - The NEVRA of all of the dependencies used in the composition * deps - The NEVRA of all of the dependencies used in the composition
* compose_type - The type of output generated (tar, iso, etc.) * compose_type - The type of output generated (tar, iso, etc.)
* queue_status - The final status of the composition (FINISHED or FAILED) * queue_status - The final status of the composition (FINISHED or FAILED)
@ -473,7 +473,7 @@ def uuid_info(cfg, uuid):
return {"id": uuid, return {"id": uuid,
"config": cfg_dict, "config": cfg_dict,
"recipe": frozen_dict, "blueprint": frozen_dict,
"commit": commit_id, "commit": commit_id,
"deps": deps_dict, "deps": deps_dict,
"compose_type": details["compose_type"], "compose_type": details["compose_type"],