-
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
Mount point asterisk #728
Mount point asterisk #728
Conversation
@@ -168,7 +169,14 @@ def device_filesystem | |||
# @return [String] | |||
def device_filesystem_mount_point | |||
# TRANSLATORS: Mount point information, where %s is replaced by a mount point | |||
format(_("Mount Point: %s"), blk_device.filesystem_mountpoint || "") | |||
res = format(_("Mount Point: %s"), blk_device.filesystem_mountpoint || "") | |||
return res unless Yast::Mode.normal |
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.
Why is the mode important?
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.
because in installation it is useless as it shows only if it is part of proposal, so shows newly mounted partition not in staging, which is something very different. Also help text does not reflect it.
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.
But during installation, all new mount points are always active, so the asterisk will be not shown in that case.
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.
I think only when they are in staging, so situation that they are not in staging cannot happen?
# TRANSLATORS: note appended to mount point if mount point is not now mounted | ||
res += _(" (not mounted)") unless blk_device.blk_filesystem.mount_point.active? | ||
|
||
res |
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.
Maybe we could avoid the high complexity error in codeclimate with a implementation like follows:
def device_filesystem_mount_point
# TRANSLATORS: Mount point information, where %s is replaced by a mount point
res = format(_("Mount Point: %s"), blk_device.filesystem_mountpoint || "")
if Yast::Mode.normal && blk_device.filesystem && blk_device.filesystem.mount_point
mount_point = blk_device.filesystem.mount_point
# TRANSLATORS: note appended to mount point if mount point is not now mounted
res += _(" (not mounted)") unless mount_point.active?
end
res
end
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.
I am not sure that it helps. If we want to reduce maybe something like
if Yast::Mode.normal && blk_device&.filesystem&.mount_point&.active? == false
res += _(" (not mounted)")
end
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 version is difficult to read for me. What about adding a new auxiliary method that checks whether it is necessary to add the ending note?
res += "(*)" if fs.mount_point && !fs.mount_point.active? | ||
end | ||
|
||
res |
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.
And here, we try something like:
def mount_point_value(device)
fs = filesystem(device)
return "" if fs.nil? || fs.mount_path.nil?
res += "(*)" if Yast::Mode.normal && !fs.mount_point.active?
res
end
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.
BTW, comparing with old partitioner, I see it more clear when I see "/mount/point *". Current version "/mount/point(*)" looks a little bit strange to me, but it is only a personal feeling.
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.
fine for me with changing it to " *"
0b9a47e
to
ea0e3a6
Compare
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
how it looks: