Skip to content
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

Merged
merged 4 commits into from
Jan 9, 2018

Conversation

lslezak
Copy link
Member

@lslezak lslezak commented Jan 9, 2018

# @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?
Copy link
Contributor

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?

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Boolean

@ancorgs
Copy link
Contributor

ancorgs commented Jan 9, 2018

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.

@yast yast deleted a comment from coveralls Jan 9, 2018
Copy link
Contributor

@joseivanlopez joseivanlopez left a 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
Copy link
Contributor

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0007%) to 96.242% when pulling 7186ccd on persistent_mount into a8fa85e on master.

@yast yast deleted a comment from coveralls Jan 9, 2018
@ancorgs ancorgs merged commit 3fcd97e into master Jan 9, 2018
@lslezak
Copy link
Member Author

lslezak commented Jan 10, 2018

@ancorgs @joseivanlopez thank you very much for the review and the improvements! 👍 🥇

@lslezak lslezak deleted the persistent_mount branch January 10, 2018 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants