From 6c44bc95cc43ca3a9cc5278d132ad8b8b86372b0 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 12 Aug 2024 14:58:32 +0200 Subject: [PATCH] Make use of custom flavor definitions possible (#988) Signed-off-by: Christian Berendt --- osism/commands/manage.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/osism/commands/manage.py b/osism/commands/manage.py index f95ad861..0666b6d7 100644 --- a/osism/commands/manage.py +++ b/osism/commands/manage.py @@ -255,7 +255,13 @@ def get_parser(self, prog_name): type=str, help="Name of flavor definitions", default="scs", - choices=["scs", "osism", "local"], + choices=["scs", "osism", "local", "url"], + ) + parser.add_argument( + "--url", + type=str, + help="Overwrite the default URL where the flavor definitions are available", + default=None, ) parser.add_argument( "--recommended", @@ -270,6 +276,7 @@ def take_action(self, parsed_args): cloud = parsed_args.cloud name = parsed_args.name recommended = parsed_args.recommended + url = parsed_args.url arguments = [f"--name '{name}'"] if cloud: @@ -278,6 +285,9 @@ def take_action(self, parsed_args): if recommended: arguments.append("--recommended") + if url: + arguments.append(f"--url '{url}'") + joined_arguments = " ".join(arguments) subprocess.call( f"/usr/local/bin/openstack-flavor-manager {joined_arguments}",