-
Notifications
You must be signed in to change notification settings - Fork 983
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
Fixes #14545 - Correctly parse y.z minor OS version from facts #3836
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,17 @@ def setup | |
refute @importer.operatingsystem.description | ||
end | ||
|
||
test 'should accept y.z minor version' do | ||
FactoryGirl.create(:operatingsystem, name: "CentOS", | ||
major: "7", | ||
minor: "2.1511", | ||
description: "CentOS Linux 7.2.1511") | ||
assert_valid PuppetFactParser.new({ "operatingsystem" => "CentOS", | ||
"lsbdistdescription" => "CentOS Linux release 7.2.1511 (Core) ", | ||
"operatingsystemrelease" => "7.2.1511" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that I care, but here's an example where enabling the cop to enforce one type of hash syntax would've been good instead of allowing 2 different hashing syntaxes to coexist. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me it kind of makes sense to use the newer syntax when passing a hash as function arguments. The second hash I think expects string keys rather then symbols, so I kept it with the old style. |
||
}).operatingsystem | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indent the right brace the same as the first position after the preceding left parenthesis. |
||
end | ||
|
||
test "should set os.major and minor correctly from AIX facts" do | ||
@importer = PuppetFactParser.new(aix_facts) | ||
assert_equal 'AIX', @importer.operatingsystem.family | ||
|
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.
No reason to save the model twice for new OSes, if there is a failing validation it will be thrown in the
.save!
below.