Revert "The onedir repo.json files should contain only full versions. Not just major."

This reverts commit 48e084d0f1.
This commit is contained in:
Pedro Algarvio 2023-03-28 19:05:23 +01:00 committed by Thomas Phipps
parent e948a82012
commit 0302fef43a

View file

@ -1102,7 +1102,8 @@ def release(ctx: Context, salt_version: str):
try:
ret = s3.head_object(Bucket=bucket_name, Key=path)
ctx.info(
f"Downloading existing '{repo_file_path.relative_to(repo_path)}' file from bucket {bucket_name}"
f"Downloading existing '{repo_file_path.relative_to(repo_path)}' "
f"file from bucket {bucket_name}"
)
size = ret["ContentLength"]
with repo_file_path.open("wb") as wfh:
@ -1543,7 +1544,8 @@ def _create_onedir_based_repo(
)
minor_versions = [v for v in versions if v.major == major_version]
ctx.info(
f"Collected versions(Matching major: {major_version}) from {minor_repo_json_path.relative_to(repo_path)}: "
f"Collected versions(Matching major: {major_version}) from "
f"{minor_repo_json_path.relative_to(repo_path)}: "
f"{', '.join(str(vs) for vs in minor_versions)}"
)
if not versions:
@ -1577,7 +1579,7 @@ def _create_onedir_based_repo(
minor_repo_json["latest"] = release_json
# This is the latest minor, update the major in the top level repo.json
# to this version
repo_json[str(salt_version)] = release_json
repo_json[str(major_version)] = release_json
ctx.info(f"Creating '{major_link.relative_to(repo_path)}' symlink ...")
if major_link.exists():
major_link.unlink()
@ -1608,7 +1610,8 @@ def _get_repo_json_file_contents(
Bucket=bucket_name, Key=str(repo_json_path.relative_to(repo_path))
)
ctx.info(
f"Downloading existing '{repo_json_path.relative_to(repo_path)}' file from bucket {bucket_name}"
f"Downloading existing '{repo_json_path.relative_to(repo_path)}' file "
f"from bucket {bucket_name}"
)
size = ret["ContentLength"]
with repo_json_path.open("wb") as wfh: