Skip to content

Instantly share code, notes, and snippets.

@romanbarczynski
Created January 27, 2011 15:24
Show Gist options
  • Save romanbarczynski/798630 to your computer and use it in GitHub Desktop.
Save romanbarczynski/798630 to your computer and use it in GitHub Desktop.
$ ruby package-test.rb
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant FileUtils (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
from /usr/lib/ruby/site_ruby/1.8/puppet/provider/package/portage.rb:85:in `query'
from /usr/lib/ruby/site_ruby/1.8/puppet/provider/package.rb:22:in `properties'
from package-test.rb:12:in `do_pkg_action'
from package-test.rb:18
def do_pkg_action(package)
require 'puppet'
if ::Puppet.version =~ /0.24/
::Puppet::Type.type(:package).clear
pkg = ::Puppet::Type.type(:package).create(:name => package).provider
else
pkg = ::Puppet::Type.type(:package).new(:name => package).provider
end
pkg.flush
print "status:", pkg.properties
# pkg.flush
# reply[:properties] = pkg.properties
end
do_pkg_action('glibc')
# vi:tabstop=4:expandtab:ai:filetype=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment