Issue #13429 has been updated by Chris Price.
I discussed this with Matt, and it sounds like the intended path forward here is to make sure that we've provided faces for anything that we expect developers to be able to use as library code. Thus, the resolution to this issue may be to ensure that the resource face provides all of the necessary functionality and that it can be called from another application. Mid-to-long term, there may yet be some "run_mode" issues that need to be worked out in support of this pattern, but they probably will not block this particular functionality. Need to discuss with Daniel; additional comments and input welcomed / appreciated. ---------------------------------------- Bug #13429: Puppet::Resource fails when used from scripts https://projects.puppetlabs.com/issues/13429#change-58780 Author: Matt Robinson Status: Accepted Priority: Normal Assignee: Chris Price 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.
