Various fixes identified using an LLM#169
Merged
Merged
Conversation
The log.error() call was passing the exception as a second positional argument without a %s placeholder, so it was silently discarded. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
subprocess.ProcessExecutionError does not exist. ProcessExecutionError is defined in curtin but isn't defined in probert. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The open() call was missing a with statement, leaving the file handle unreferenced until garbage collection. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
* Requsted -> Requested * Unavilable -> Unavailable Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
There was a problem hiding this comment.
Pull request overview
This PR applies several small correctness and user-facing fixes across probert’s storage, firmware, DASD, dmcrypt, and ZFS probing paths, with added tests for selected ZFS and DASD behavior.
Changes:
- Fixes formatting/typo issues in exceptions, logs, schema keys, and printed messages.
- Updates DASD
/proc/devicesreading to close the file via a context manager. - Adds/updates tests for ZFS property probing and DASD virtio detection.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
probert/zfs.py |
Updates invalid-name error formatting and exception type for ZFS property probing. |
probert/tests/test_zfs.py |
Adds tests for ZFS property parsing, empty-name validation, and subprocess errors. |
probert/tests/test_dasd.py |
Updates virtio DASD tests to mock context-managed file access. |
probert/storage.py |
Corrects typos in user-facing probe availability messages. |
probert/firmware.py |
Corrects the firmware schema property name for BIOS release date. |
probert/dmcrypt.py |
Fixes exception interpolation in dmsetup logging. |
probert/dasd.py |
Wraps /proc/devices reading in a context manager. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cmd = ['zfs', 'get', 'all', '-Hp', zfs_name] | ||
| try: | ||
| result = subprocess.run(cmd, stdout=subprocess.PIPE, | ||
| stderr=subprocess.DEVNULL) |
Member
Author
There was a problem hiding this comment.
You're right! With that said, all subprocess.run in probert have an unreachable except subprocess.CalledProcessError block.
I would like to take care of them in a separate PR.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
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.
This PR fixes:
curtin.util, not in probert, nor insubprocess)Some tests added, covering the fixes.