manage images: default --cloud to admin#2472
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new test hardcodes knowledge of the cfg-cookiecutter
clouds.ymlcontents; 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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A bare
osism manage imagesfails on every standard OSISM deployment with:The
Imagescommand defaulted--cloudtoopenstack, a profile thatcfg-cookiecutter'sclouds.ymlnever ships — it providesadmin,admin-system, andoctavia. Theopenstackvalue was inherited from the standaloneopenstack-image-managertool rather than OSISM's own operator-profile convention.This diverged from the sibling subcommands, all of which already default to
admin:clouds.yml?manage imagesopenstackmanage flavorsadminmanage project *adminChange
manage images--cloudtoadmin, so the documented bare invocation works out of the box.