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
Support latest Puppet versions 4 and 5 and drop support for v3 #31
Conversation
spec/classes/init_spec.rb
Outdated
end | ||
|
||
mandatory_facts = platforms['el7'][:facts_hash] |
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.
@Phil-Friderici I get this error with or without specifying this line. Any ideas why it is always failing on the valid matches? Seems that it doesn't know the $facts['os']['family']
though I thought I am specifying it.
The error is
Failure/Error: it { should compile }
error during compilation: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /Users/gh/git/puppet-module-rpcbind/spec/fixtures/modules/rpcbind/manifests/init.pp, line: 23, column: 6)
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.
Can't test myself at the moment. Could you please try to add curly brackets like this:
mandatory_facts = { platforms['el7'][:facts_hash] }
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.
@Phil-Friderici Thanks for having a look!
That gives an error.
added some puts to give the following output with the code as it currently is.
mandatory_facts class is Hash and the value is
{
:osfamily=>"RedHat",
:operatingsystem=>"RedHat",
:operatingsystemmajrelease=>"7",
:os=> {
"name"=>"RedHat",
"family"=>"RedHat",
"release"=> {
"full"=>"7.0.1406",
"major"=>"7",
"minor"=>"0"
}
}
}
Made some other changes, though still getting the same error. If I comment out the platform validation parts in the manifest, then the type validation passes, so it seems that it does not know about the specified facts.
Added another commit.
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.
In general there is no need to explicilty set the variable mandatory_facts
. It can be left empty. I had added and used it to set non OS related facts in the past.
Guess it will be simplier to just set the OS like in the other cases with:
describe 'variable data type and content validations' do
let(:facts) { platforms['el7'][:facts_hash] }
validations = {
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.
great idea! that worked!
type validation is failing on the valid matches. Once this is fixed, it will be good to merge. |
Support latest Puppet versions 4 and 5 and drop support for v3 Parameter names have stayed the same, so migration should be as simple as installing this new version. Supported platforms have changed based on their posted end of life (EOL). Dropped * Debian 6 * EL 5 * Suse 10 * Ubuntu 12.04 LTS Added * Debian 8 * Debian 9 * EL 7
Parameter names have stayed the same, so migration should be as simple
as installing this new version.
Supported platforms have changed based on their posted end of life
(EOL).
Dropped
Added