Preview images by default, require --upload#1251
Open
jklare wants to merge 2 commits into
Open
Conversation
Running openstack-image-manager (and "osism manage images", which wraps it) previously imported images immediately when invoked without arguments. This meant the default action changed the cloud (uploading images and running outdated-image management) and required a working OpenStack connection just to see what the tool would do. Make the default a safe, local-only preview instead. Without --upload the tool now lists the images that would be uploaded, shows the total download size and a rough time estimate, prints the exact command to perform the upload, and links to the documentation. It does not connect to OpenStack and makes no changes. Passing --upload restores the previous import and cleanup behaviour; --dry-run continues to work within that path. The preview is derived purely from the local image definitions, honouring the same enable/force/filter rules as a real run as well as --latest for images of type multi, and prefers mirror_url over url. Download sizes are determined via HTTP HEAD requests (or the local filesystem for file: URLs); the time estimate assumes a rough 10-30 MB/s throughput range and is intentionally vague. This is a clean break: automation relying on the implicit upload must now pass --upload. The Zuul integration test is updated accordingly. The osism manage images wrapper lives in the osism/osism repository and must be updated there separately to pass --upload. DocImpact Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Jan Klare <klare@osism.tech>
Contributor
Author
|
Only unit tests were run so far, so this needs to be verified against a testbed before it can be merged. |
mypy could not prove that the size-formatting loop always returns, because the guaranteed exit relied on the final list element rather than on a statement it could see. Iterate over the smaller units only and return the TiB case unconditionally after the loop so the function provably returns a str on every path. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Jan Klare <klare@osism.tech>
1 task
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.
What
Running
openstack-image-manager(andosism manage images, which wraps it) previously imported images immediately when invoked without arguments. This meant the default action changed the cloud (uploading images and running outdated-image management) and required a working OpenStack connection just to see what the tool would do.This change makes the default a safe, local-only preview. Without
--uploadthe tool now:It does not connect to OpenStack and makes no changes. Passing
--uploadrestores the previous import and cleanup behaviour;--dry-runcontinues to work within that path.Details
--latestfor images of typemulti, and prefersmirror_urloverurl.file:URLs); the time estimate assumes a rough 10-30 MB/s throughput range and is intentionally vague.Example:
Breaking change
This is a clean break: automation relying on the implicit upload must now pass
--upload. The Zuul integration test is updated accordingly.Important
The
osism manage imageswrapper lives in the osism/osism repository and must be updated there separately to pass--upload.Testing
flake8clean