-
Notifications
You must be signed in to change notification settings - Fork 364
Fix: Partition unmount for issue 4463 #6243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Partition unmount for issue 4463 #6243
Conversation
WalkthroughThe unmount API in avocado/utils/partition.py is extended with an optional Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
avocado/utils/partition.py (1)
304-305: Clarify the docstring with usage guidance and safety notes.The docstring documents the new parameter but could be clearer about when to use it and any safety considerations.
Consider enhancing the docstring:
- :param force: Whether to force unmount if the standard unmount fails. - :param mountpoint: Optional mountpoint to unmount. If not provided, the current mountpoint of the partition object will be used. + :param force: Whether to force unmount if the standard unmount fails. + :param mountpoint: Optional mountpoint to unmount. If not provided, + the method will auto-detect the mountpoint from the device. + Use this parameter when you need to specify a mountpoint + that differs from the partition object's stored value. :return: 1 on success, 2 on force umount success
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
avocado/utils/partition.py(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (26)
- GitHub Check: rpm-build:fedora-41-ppc64le
- GitHub Check: rpm-build:epel-9-x86_64
- GitHub Check: rpm-build:fedora-42-x86_64
- GitHub Check: rpm-build:fedora-41-aarch64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:centos-stream-9-x86_64
- GitHub Check: rpm-build:fedora-41-s390x
- GitHub Check: rpm-build:fedora-41-aarch64
- GitHub Check: rpm-build:fedora-41-s390x
- GitHub Check: rpm-build:fedora-42-x86_64
- GitHub Check: rpm-build:centos-stream-9-x86_64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-41-ppc64le
- GitHub Check: rpm-build:fedora-41-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:epel-9-x86_64
- GitHub Check: rpm-build:fedora-41-aarch64
- GitHub Check: rpm-build:centos-stream-9-x86_64
- GitHub Check: rpm-build:fedora-41-ppc64le
- GitHub Check: rpm-build:fedora-41-x86_64
- GitHub Check: rpm-build:epel-9-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-42-x86_64
- GitHub Check: rpm-build:fedora-41-s390x
🔇 Additional comments (1)
avocado/utils/partition.py (1)
310-311: Review comment is incorrect and should be disregarded.The code is already correct and idempotent. The
self.mountpointattribute is a configured default (set once at construction), not a live state indicator. Theget_mountpoint()method queries actual OS mount state from/proc/mounts, notself.mountpoint. After successful unmount, OS file systems are updated, so subsequentunmount()calls return early with no error. Clearingself.mountpointwould incorrectly break themount()method's ability to use the stored default on subsequent operations.Likely an incorrect or invalid review comment.
clebergnu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the CI failure is unrelated.
| When the unmount fails and force==True we unmount the partition | ||
| ungracefully. | ||
| :param force: Whether to force unmount if the standard unmount fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be in an separate commit, but... it's probably me being too picky.
#4463
I have modified the unmount () method of the Partition class, which now supports specifying a mount point during uninstallation. If no mount point parameter is provided, the mount point of the current object will be used. This allows for specifying mount points during class initialization and uninstallation to maintain consistency.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.