Skip to content

Commit

Permalink
119 generate script: --list does generate files and missing help te…
Browse files Browse the repository at this point in the history
…xts (#120)

* fixed: list option working as intended

- added some help texts
- reformatted log output

Signed-off-by: Danny Eiselt <[email protected]>

* changed: python script formatted and linted

Signed-off-by: Danny Eiselt <[email protected]>

---------

Signed-off-by: Danny Eiselt <[email protected]>
  • Loading branch information
DEiselt committed Jun 26, 2024
1 parent 2605f0f commit 187a8fe
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions hack/generate_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import logging
import shutil
import subprocess
import sys
from pathlib import Path, PosixPath

import yaml
Expand Down Expand Up @@ -151,7 +152,9 @@ def update_cluster_addon(
if dep["name"] == "openstack-cloud-controller-manager":
dep["version"] = versions["occm"]

content["name"] = f"openstack-scs-{get_dash_version(versions["kubernetes"])}-cluster-addon"
content["name"] = (
f"openstack-scs-{get_dash_version(versions["kubernetes"])}-cluster-addon"
)

writefile(target, content)

Expand Down Expand Up @@ -231,12 +234,19 @@ def update_node_images(target: PosixPath, **kwargs):


if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
logger.info("Starting")
LOGFORMAT = "%(asctime)s - %(levelname)s: %(message)s"
logging.basicConfig(level=logging.INFO, encoding="utf-8", format=LOGFORMAT)
# Initialize arg parser
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--target-version", type=str)
parser.add_argument("-l", "--list", action="store_true")
parser.add_argument(
"-t",
"--target-version",
type=str,
help="Generate files for version specified like 1.XX. See '-l' to list supported versions.",
)
parser.add_argument(
"-l", "--list", action="store_true", help="List supported versions and exit."
)
parser.add_argument("--build", action="store_true", help="Build helm dependencies.")
parser.add_argument(
"--build-verbose", action="store_false", help="Show output of helm build"
Expand All @@ -251,6 +261,7 @@ def update_node_images(target: PosixPath, **kwargs):
for v in sup_versions:
print(f"{".".join(v["kubernetes"].split(".")[0:2])}")
print("Usage: generate_version.py --target-version VERSION")
sys.exit()

# filter versions to generate
if args.target_version:
Expand Down

0 comments on commit 187a8fe

Please sign in to comment.