Skip to content

Commit f7b1f33

Browse files
committed
Merge pull request redhat-openstack#254 from misterdorm/pluginparsing
Use -m flag on rabbitmq-plugins command for managing rabbitmq_plugin res...
2 parents 3ff4dd1 + d262edb commit f7b1f33

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
defaultfor :feature => :posix
2222

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

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

0 commit comments

Comments
 (0)