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

Sle 15 sp1 bsc 1132915 #797

Merged
merged 4 commits into from May 14, 2019
Merged

Sle 15 sp1 bsc 1132915 #797

merged 4 commits into from May 14, 2019

Conversation

schubi2
Copy link
Member

@schubi2 schubi2 commented May 10, 2019

Has also been tested by the reporter.

)
if Installation.boot == "cd" && !cdrom_device.empty?
mtab = File.read("/proc/mounts")
if mtab.include?(cdrom_device)
Copy link
Member

@wfeldt wfeldt May 13, 2019

Choose a reason for hiding this comment

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

Wouldn't a regexp that at least guarantees that mtab.split().find below finds something be better? include? does only a substring match and that could be anything.

)
if Installation.boot == "cd" && !cdrom_device.empty?
mtab = File.read("/proc/mounts")
if mtab.include?(cdrom_device)
Builtins.y2warning(
Copy link
Member

Choose a reason for hiding this comment

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

Not part of the patch, but anyway: why a warning? This is imho a normal situation - so y2milestone.

Builtins.y2warning(
if Installation.boot == "cd" && !cdrom_device.empty?
mtab = File.read("/proc/mounts")
if mtab.match(Regexp.new("^#{cdrom_device}"))
Copy link
Member

@wfeldt wfeldt May 14, 2019

Choose a reason for hiding this comment

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

I'd add at least a space: Regexp.new("^#{cdrom_device}\\s"). But why not simply

m = mtab.match(/^#{cdrom_device}\s+(\S+)/)

where m[1] then is the mountpoint and get rid of this split and find business?

Copy link
Member

@wfeldt wfeldt left a comment

Choose a reason for hiding this comment

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

lgtm

@wfeldt
Copy link
Member

wfeldt commented May 14, 2019

changelog? - I found it :-)

@schubi2 schubi2 merged commit 0de6cf0 into SLE-15-SP1 May 14, 2019
@schubi2 schubi2 deleted the SLE-15-SP1-bsc-1132915 branch May 14, 2019 12:07
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.

None yet

2 participants