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

Support for Puppet 3.0 #54

Closed
antonlindstrom opened this issue Oct 1, 2012 · 3 comments
Closed

Support for Puppet 3.0 #54

antonlindstrom opened this issue Oct 1, 2012 · 3 comments

Comments

@antonlindstrom
Copy link

When running tests with rspec-puppet against Puppet 3.0 the run fails with the message:

Error converting value for param 'statedir': Could not find value for $vardir on node example.local

For example, I ran the test powerdns__package_spec.rb and got the following output:

1) powerdns::package 
   Failure/Error: it { should contain_package('pdns-server').with_ensure('present') }
   Puppet::Error:
     Error converting value for param 'statedir': Could not find value for $vardir on node example.local
   # ./spec/classes/powerdns__package_spec.rb:5:in `block (2 levels) in <top (required)>'

This may be related fixes: puppet issue 13429, mcollective-plugin PR 38.

Thanks!

@jumanjiman
Copy link

@antonlindstrom I found this issue via Google after encountering the same error you describe above.
The error went away after I updated the Gemfile in my puppet manifests repo as:

diff --git a/Gemfile b/Gemfile
index 74fa739..ba9a394 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,13 +1,18 @@
 source :rubygems
 gem "puppetlabs_spec_helper", "~>0.4"
-gem "mocha", "0.12.7"
-gem "rspec-core", "2.11.1"
+gem "mocha", "0.13.2"
+gem "rspec-core", "2.12.2"
+gem "rspec", "2.12.0"
+gem "rspec-expectations", "2.12.1"
+gem "rspec-mocks", "2.12.2"
 gem "puppet-lint", "~>0.3.2"
-gem "puppet", "~> 2.7.19"
-gem "rspec-puppet", "0.1.4"
-gem "hiera", "1.1.0"
+gem "puppet", "~> 3.0.2"
+gem "rspec-puppet", "~> 0.1"
+gem "hiera", "~> 1.0"
 gem "hiera-puppet", "1.0.0"
 gem "fastercsv", "1.5.5", :platforms => [:ruby_18, :mingw_18]
-gem "rspec-hiera-puppet", "0.3.0"
+gem "rspec-hiera-puppet", "~> 1.0.0"
 gem "open4", "1.3.0"
 gem "puppet-catalog-test", "0.1.0"
+gem "diff-lcs", ">= 1.1.3"
+gem "metaclass", "~> 0.0.1"

https://travis-ci.org/rodjek/rspec-puppet/jobs/4361531 shows that rspec-puppet succeeds on ruby 1.9.3 and puppet 3.0.0, so I ran bundler on my workstation within the rspec-puppet git repo. rake test worked locally, so I updated my Gemfile with the versions that I got when running bundler with rspec-puppet.

@antonlindstrom
Copy link
Author

Cheers! Closing this issue.

ngkim pushed a commit to ngkim/cloudify-recipes that referenced this issue May 19, 2014
According to the puppet documentation, this parameter should be
populated with a default value of /var/lib/puppet (when running as
root), but it fails to do so. For now, I've hard-coded this default
which should be good for the current needs.

The direct symptom prior to the fix was the following:
    Error: Could not intialize global default settings: Error converting
    value for param 'factpath': Could not find value for $vardir

We are still trying to understand what causes the issue.
The following is a related bug found in the puppet tests
rodjek/rspec-puppet#54
@logicminds
Copy link

I know this issue is closed but have come across this issue with other code bases and found this issue to be helpful. The better fix is to do the following:

begin
    Puppet.initialize_settings
 rescue
        # do nothing otherwise calling init twice raises an error
 end

ekohl pushed a commit to ekohl/rspec-puppet that referenced this issue Jul 14, 2023
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

No branches or pull requests

3 participants