-
Notifications
You must be signed in to change notification settings - Fork 12
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
bsc#1045098: Fix regular expression to check alloc_mem parameter #82
Conversation
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.
Looks good to me. But I would wait for @mvidner before merging.
test/client_test.rb
Outdated
context "When using wrong inputs in alloc memory" do | ||
let(:options) {{"enable"=>"", "alloc_mem"=>"#{alloc_mem_low}:#{alloc_mem_high}"}} | ||
|
||
it "does not enable kdump and return false" do |
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.
returns
src/clients/kdump.rb
Outdated
alloc_mem_low, alloc_mem_high = options["alloc_mem"].split(',') | ||
Kdump.allocated_memory = { low: alloc_mem_low, high: alloc_mem_high } | ||
unless alloc_mem_low =~ ALLOC_MEM_REGEXP && | ||
(alloc_mem_high.nil? || alloc_mem_high =~ ALLOC_MEM_REGEXP) | ||
CommandLine.Error(_("Invalid allocation memory parameter")) |
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.
"allocation memory" is wrong, it should be "memory allocation"; but even better, quote the actual parameter name
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.
Is it better: "alloc_mem parameter used with invalid values" ?
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.
Yes.
No description provided.