diff options
author | Aaron Stone <aaron@serendipity.cx> | 2013-07-25 12:57:21 -0700 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2013-07-25 12:57:21 -0700 |
commit | 164cadc9b9ac25ce70885100f28f8cd649358fa4 (patch) | |
tree | 0abfe677d87ef91126b76afc9f072a9eadb61daa /lib/puppet | |
parent | 7e87ef1cf732641fa6390bf2c9011e4277b01aea (diff) | |
parent | 7b2b5e766ede2408079a8760221d653e2e32eef4 (diff) | |
download | puppet-vcsrepo-164cadc9b9ac25ce70885100f28f8cd649358fa4.tar.gz puppet-vcsrepo-164cadc9b9ac25ce70885100f28f8cd649358fa4.tar.bz2 |
Merge pull request #86 from sodabrew/puppet_util_withenv
Correct use of withenv
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/provider/vcsrepo/cvs.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/cvs.rb b/lib/puppet/provider/vcsrepo/cvs.rb index 6b64ba7..206e732 100644 --- a/lib/puppet/provider/vcsrepo/cvs.rb +++ b/lib/puppet/provider/vcsrepo/cvs.rb @@ -125,7 +125,12 @@ Puppet::Type.type(:vcsrepo).provide(:cvs, :parent => Puppet::Provider::Vcsrepo) e = {} end - Puppet::Util::Execution.withenv e do + # The location of withenv changed from Puppet 2.x to 3.x + withenv = Puppet::Util.method(:withenv) if Puppet::Util.respond_to?(:withenv) + withenv = Puppet::Util::Execution.method(:withenv) if Puppet::Util::Execution.respond_to?(:withenv) + fail("Cannot set custom environment #{e}") if e && !withenv + + withenv.call e do Puppet.debug cvs *args end end |