Skip to content

manage images: default --cloud to admin#2472

Merged
jklare merged 1 commit into
mainfrom
fix-manage-images-default-cloud
Jul 16, 2026
Merged

manage images: default --cloud to admin#2472
jklare merged 1 commit into
mainfrom
fix-manage-images-default-cloud

Conversation

@ideaship

@ideaship ideaship commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

A bare osism manage images fails on every standard OSISM deployment with:

ConfigException: Cloud openstack was not found.

The Images command defaulted --cloud to openstack, a profile that cfg-cookiecutter's clouds.yml never ships — it provides admin, admin-system, and octavia. The openstack value was inherited from the standalone openstack-image-manager tool rather than OSISM's own operator-profile convention.

This diverged from the sibling subcommands, all of which already default to admin:

Subcommand old default in shipped clouds.yml?
manage images openstack no → fails bare
manage flavors admin yes → works bare
manage project * admin yes → works bare

Change

  • Default manage images --cloud to admin, so the documented bare invocation works out of the box.
  • Add a regression guard asserting the parsed default.

A bare `osism manage images` failed on every standard OSISM
deployment with `ConfigException: Cloud openstack was not found`.
The Images command defaulted --cloud to "openstack", a profile that
cfg-cookiecutter's clouds.yml never ships: it provides admin,
admin-system, and octavia. The "openstack" value was inherited from
the standalone openstack-image-manager tool rather than OSISM's own
operator-profile convention.

Change the default to "admin", matching the sibling subcommands
(manage flavors, manage project *) and a profile that actually
exists in the shipped clouds.yml, so the documented bare invocation
works out of the box. Add a regression guard asserting the parsed
default.

DocImpact
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship ideaship marked this pull request as ready for review July 16, 2026 08:31
@ideaship ideaship requested a review from jklare July 16, 2026 08:32
@ideaship ideaship moved this from New to In review in Human Board Jul 16, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new test hardcodes knowledge of the cfg-cookiecutter clouds.yml contents; consider centralizing the default cloud name in a shared configuration/constant so future profile changes don’t require hunting down literals in both parser and tests.
  • Since other manage subcommands already default to admin, it might be useful to add a small helper or shared base logic for parser construction to ensure all future manage commands use consistent cloud defaults without repeating string literals.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new test hardcodes knowledge of the cfg-cookiecutter `clouds.yml` contents; consider centralizing the default cloud name in a shared configuration/constant so future profile changes don’t require hunting down literals in both parser and tests.
- Since other manage subcommands already default to `admin`, it might be useful to add a small helper or shared base logic for parser construction to ensure all future manage commands use consistent cloud defaults without repeating string literals.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jklare jklare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jklare jklare merged commit 8c29c67 into main Jul 16, 2026
4 checks passed
@jklare jklare deleted the fix-manage-images-default-cloud branch July 16, 2026 08:38
@github-project-automation github-project-automation Bot moved this from In review to Done in Human Board Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants