Skip to content

Commit

Permalink
(MODULES-1411) Puppet 2.7 doesn't have has_command
Browse files Browse the repository at this point in the history
  • Loading branch information
hunner committed Oct 16, 2014
1 parent 54e1d2c commit 36307c0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
require 'puppet'
Puppet::Type.type(:rabbitmq_exchange).provide(:rabbitmqadmin) do

commands :rabbitmqctl => '/usr/sbin/rabbitmqctl'
has_command(:rabbitmqadmin, '/usr/local/bin/rabbitmqadmin') do
environment( { 'HOME' => '' })
if Puppet::PUPPETVERSION.to_f < 3
commands :rabbitmqctl => 'rabbitmqctl'
commands :rabbitmqadmin => '/usr/local/bin/rabbitmqadmin'
else
has_command(:rabbitmqctl, 'rabbitmqctl') do
environment :HOME => "/tmp"
end
has_command(:rabbitmqadmin, '/usr/local/bin/rabbitmqadmin') do
environment :HOME => "/tmp"
end
end
defaultfor :feature => :posix

Expand Down

0 comments on commit 36307c0

Please sign in to comment.