Issue #13429 has been reported by Matt Robinson.
----------------------------------------
Bug #13429: Puppet::Resource fails when used from scripts
https://projects.puppetlabs.com/issues/13429
Author: Matt Robinson
Status: Accepted
Priority: Normal
Assignee:
Category:
Target version: Telly
Affected Puppet version:
Keywords:
Branch:
Something changed in the master branch in
commit:e465c160d6d6c592a86aba2db74c5c9e5cb0ecab that broke the way
mcollective's puppetral agent uses Puppet::Resource. It used to be the
following would work to create a puppet resource:
require 'puppet'
Puppet.settings.parse
resource = Puppet::Resource.new('file', '/tmp/blahd', :parameters => {
:ensure ='present', :content => "blahd" })
result, report = Puppet::Resource.indirection.save(resource)
Now running that gets the following error:
/Users/matthewrobinson/work/puppet/lib/puppet/util/settings.rb:838:in
`value': Error converting value for param 'statedir': Could not find value for
$vardir (Puppet::SettingsError)
from /Users/matthewrobinson/work/puppet/lib/puppet/util/settings.rb:50:in
`[]'
from /Users/matthewrobinson/work/puppet/lib/puppet.rb:65:in `[]'
from /Users/matthewrobinson/work/puppet/lib/puppet/util/storage.rb:47:in
`load'
from
/Users/matthewrobinson/work/puppet/lib/puppet/resource/catalog.rb:130:in `apply'
from
/Users/matthewrobinson/work/puppet/lib/puppet/indirector/resource/ral.rb:30:in
`save'
from
/Users/matthewrobinson/work/puppet/lib/puppet/indirector/indirection.rb:271:in
`save'
from /Users/matthewrobinson/resource.rb:4
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.