-
Notifications
You must be signed in to change notification settings - Fork 20
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
Added Mountable#persistent? (needed for bsc#1073696) #485
Conversation
lslezak
commented
Jan 9, 2018
- See also Ignore the partition with the installer (bsc#1073696) yast-packager#308
- 4.0.68
src/lib/y2storage/mountable.rb
Outdated
# @return [Boolen] true if the mount point is saved to /etc/fstab | ||
# (and will be mounted at boot again), false otherwise | ||
def persistent? | ||
to_storage_value.mount_point.in_etc_fstab? |
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 can raise an exception if there is no mount point. This should be more robust:
to_storage_value.has_mount_point && to_storage_value.mount_point.in_etc_fstab?
src/lib/y2storage/mountable.rb
Outdated
@@ -88,6 +88,13 @@ def mountpoint=(path) | |||
|
|||
alias_method :mount_point=, :mountpoint= | |||
|
|||
# Is the mount persistent? | |||
# @return [Boolen] true if the mount point is saved to /etc/fstab |
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.
typo: Boolean
Adding a simple unit test should not be that hard. For example, assigning a mountpoint to an existing filesystem and verifying that it becomes persistent. I will try to provide some code as starting point, give me a sec. |
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 (if travis does not say another thing). Only one NP comment.
# Is the mount persistent? | ||
# | ||
# @return [Boolean] true if the mount point is saved to /etc/fstab | ||
# (and will be mounted at boot again), false otherwise |
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.
NP: I would add a "TODO" to say that this should be adapted once MountPoint
wrapper class is there.
@ancorgs @joseivanlopez thank you very much for the review and the improvements! 👍 🥇 |