-
Notifications
You must be signed in to change notification settings - Fork 39
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
Remove dependency on puppet-common #197
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.
Neat! This has been on my mental todo list.
@@ -0,0 +1,15 @@ | |||
module Puppet::Parser::Functions |
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 we can get rid of this since we have puppet data types. It means changing Optional[String] $certs_tar
to String[1] $certs_tar
. The fqdn check should already be redundant. It also means we can remove the if $certs_tar
since that looks like a useless check.
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 see. Will give it a try
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 mean the whole function can be removed since we can simply replace all function calls with Puppet 4 data types.
context 'with empty certs_tar' do | ||
let(:params) { { certs_tar: '' , foreman_proxy_fqdn: 'example.com' } } | ||
|
||
it { should_not compile.with_all_deps } |
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 you can leave off the .with_all_deps
. Otherwise it could compile with with a missing dependency hiding a real failure. Same with the lower text.
it { should_not compile.with_all_deps } | ||
end | ||
|
||
context 'missing foreman_proxy_fqdn' 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.
I think this is redundant since we default to $::fqdn
so you actually need to put in an effort to break this I think. We should change the datatype from Optional[String] $parent_fqdn
to String[1] $parent_fqdn
as well I think.
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.
makes sense!
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.
@@ -15,4 +15,10 @@ | |||
describe 'with default parameters' do | |||
it { should compile.with_all_deps } | |||
end | |||
|
|||
context 'with empty certs_tar' do | |||
let(:params) { { certs_tar: '' , foreman_proxy_fqdn: 'example.com' } } |
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.
We can probably leave out the fqdn parameter (and in the basic test too).
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 like basic tests needs the default fqdn for one scenario:
Failure/Error: it { should compile.with_all_deps }
error during compilation: Evaluation Error: Error while evaluating a Function Call, The hostname is the same as the provided hostname for the foreman-proxy at /home/travis/build/theforeman/puppet-certs/spec/fixtures/modules/certs/manifests/foreman_proxy_content.pp:22:5 on node travis-job-theforeman-puppet-certs-377315866.travisci.net
certs::qpid_client
on centos-7-x86_64
without parameters
should compile into a catalogue without dependency cycles (FAILED - 1)
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.
Ah right :)
require 'spec_helper' | ||
require 'puppetlabs_spec_helper/puppetlabs_spec/puppet_internals' | ||
|
||
describe 'validate_file_exists' 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.
This can probably use a test and verify that /
does exist.
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, thanks @jturel!
@jturel Can you also remove puppet-common from https://github.com/Katello/katello-installer/blob/master/Puppetfile#L6? |
ah ok! I was missing where the dependency was actually included |
Thanks! |
there wasn't a dependency on puppet-common in the manifest. that seems unexpected!