Skip to content

Commit

Permalink
Make use of custom flavor definitions possible (#988)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored Aug 12, 2024
1 parent 27afee0 commit 6c44bc9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion osism/commands/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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:
Expand All @@ -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}",
Expand Down

0 comments on commit 6c44bc9

Please sign in to comment.