diff options
author | Michael Franz Aigner <mike@ecommerce.com> | 2013-02-28 08:17:37 -0500 |
---|---|---|
committer | Michael Franz Aigner <mike@ecommerce.com> | 2013-02-28 08:17:37 -0500 |
commit | 02bbc22223f53d979c1ab5724e26aa2ac4c22c7a (patch) | |
tree | 1bdcb33b8c40fe5c98f7034f4be6aa32451dd028 /lib/puppet | |
parent | 27775313728aa85d8c127f7d37fccd97054fe965 (diff) |
Removing calls to Puppet.features.rubygems?
This makes the Gem usable in the latest Puppet versions.
The handling of RubyGems got revised in Puppet 3.0.1-rc1:
http://projects.puppetlabs.com/issues/16757
The new policy is that either bundler and/or rubygems are guaranteed to
be loaded and initialized when the Puppet manifest is evaluated, making
it unnecessary for Puppet modules to load rubygems.
This new policy broke the puppet-trocla module. This is because
'Puppet.features.rubygems?' always evaluates to false now, which causes
the module to abort the manifest compilation with a message informing
about the necessity of RubyGems to be present.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/parser/functions/trocla_set.rb | 4 | ||||
-rw-r--r-- | lib/puppet/util/trocla_helper.rb | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/lib/puppet/parser/functions/trocla_set.rb b/lib/puppet/parser/functions/trocla_set.rb index 5b6079a..c3c9b49 100644 --- a/lib/puppet/parser/functions/trocla_set.rb +++ b/lib/puppet/parser/functions/trocla_set.rb @@ -50,9 +50,7 @@ trocla, for example via cli. configfile = File.join(File.dirname(Puppet.settings[:config]), "troclarc.yaml") raise(Puppet::ParseError, "Trocla config file #{configfile} not readable") unless File.exist?(configfile) - raise(Puppet::ParseError, "You need rubygems to use Trocla") unless Puppet.features.rubygems? - - require 'rubygems' + require 'trocla' result = (trocla=Trocla.new(configfile)).set_password(key,format,value) diff --git a/lib/puppet/util/trocla_helper.rb b/lib/puppet/util/trocla_helper.rb index 58ccf9c..64ef859 100644 --- a/lib/puppet/util/trocla_helper.rb +++ b/lib/puppet/util/trocla_helper.rb @@ -25,9 +25,7 @@ module Puppet::Util::TroclaHelper configfile = File.join(File.dirname(Puppet.settings[:config]), "troclarc.yaml") raise(Puppet::ParseError, "Trocla config file #{configfile} is not readable") unless File.exist?(configfile) - raise(Puppet::ParseError, "You need rubygems to use Trocla") unless Puppet.features.rubygems? - require 'rubygems' require 'trocla' has_options ? Trocla.new(configfile).send(trocla_func, key, format, options) : Trocla.new(configfile).send(trocla_func, key, format) |