storage: report success from rollback and commit - #608
Merged
chombourger merged 1 commit intoAug 24, 2026
Conversation
mtda-cli prints "could not rollback changes made to shared storage!" and exits non-zero after a rollback which did what it was asked to, as reported in siemens#597. Neither rollback() nor commit() returns anything in the usbf and qemu controllers, so they yield None. main.storage_rollback() passes that on, and the gRPC servicer wraps it with bool(value), which turns None into False. mtda-cli then takes `status is False` as a failure. Both now return True on the paths that completed, and on the ignore_missing path where there was nothing to do. Every other storage method - to_host, to_target, mount, open, close - already returns a value; these four were the exception. The other callers of rollback() and commit() ignore the return value (helpers/image.py, and the internal calls in usbf.py and qemu.py), so only the CLI path changes behaviour. Signed-off-by: George Vasiliades <1221374+Poseidonas@users.noreply.github.com>
Collaborator
|
thank you @Poseidonas - changes LGTM. I am running our CI even though I understand that your changes will not be exercised. that's more of a checklist type of things than anything else. |
Collaborator
|
I also changed the target branch from |
chombourger
approved these changes
Aug 24, 2026
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.
Fixes #597.
mtda-cli storage rollbackprintscould not rollback changes made to shared storage!and exits non-zero after a rollback which did exactly what it was asked to, so the reporter has to write|| :around it.Where the false failure comes from
bool(None)is where it turns into a failure. The same applies tocommit, and to both the usbf and qemu controllers.The fix
return Trueon the paths that completed, and on theignore_missingpath where there was nothing to do.This is not a new convention: every other storage method already returns a value.
I checked the other callers before changing the signature —
helpers/image.py:72,usbf.py:286andqemu.py:64all discard the return value, so only the CLI path behaves differently.On
ignore_missingI chose
Truethere. The only caller ishelpers/image._close(), which ignores the result, so nothing depends on it;Trueseemed the better reading of "there was no copy-on-write device, so there was nothing to roll back" —Falsewould report a failure that did not happen. Happy to flip it if you read it the other way.What I verified, and what I could not
Verified by driving both controllers with the subprocess calls patched out: all four methods return
Trueon the normal path and onignore_missing.flake8is clean with the exclusions fromtox.ini.I could not run
scripts/test-using-dockerhere: thearchlinuximage has nolinux/arm64manifest, andmtda-serviceimportssystemd, which is not installable on macOS. So this rests on reading the call chain and on the isolated check above rather than on the integration suite — worth a second look on that account.I did not add a test. The suite is integration-based against a live service, and the docker backend has no
rollbackto exercise. If you would like one, I am glad to add it in whatever shape fits.