Skip to content

Commit

Permalink
Use -m flag on rabbitmq-plugins command for managing rabbitmq_plugin …
Browse files Browse the repository at this point in the history
…resources

Use the -m flag for calls to the rabbitmq-plugins command, which enables minimal
output mode.  This is much easier and more reliable to parse.

Fixes an issue under RMQ 3.4.0 where rabbitmq_plugin resources were being enabled
on every Puppet run, even though they are already enabled.
  • Loading branch information
Mike Dorman committed Nov 14, 2014
1 parent 61991d7 commit d262edb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
defaultfor :feature => :posix

def self.instances
rabbitmqplugins('list', '-E').split(/\n/).map do |line|
if line.split(/\s+/)[1] =~ /^(\S+)$/
rabbitmqplugins('list', '-E', '-m').split(/\n/).map do |line|
if line =~ /^(\S+)$/
new(:name => $1)
else
raise Puppet::Error, "Cannot parse invalid plugins line: #{line}"
Expand All @@ -39,8 +39,8 @@ def destroy
end

def exists?
rabbitmqplugins('list', '-E').split(/\n/).detect do |line|
line.split(/\s+/)[1].match(/^#{resource[:name]}$/)
rabbitmqplugins('list', '-E', '-m').split(/\n/).detect do |line|
line.match(/^#{resource[:name]}$/)
end
end

Expand Down

0 comments on commit d262edb

Please sign in to comment.