Skip to content

Commit 3f811e5

Browse files
authored
Merge pull request voxpupuli#912 from kvisle/bugfix/plugin_resource_broken_310
Make rabbitmq_plugin resource functional on RabbitMQ 3.10.x
2 parents 277e3e8 + 3436f22 commit 3f811e5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def self.instances
1212
end
1313

1414
plugin_list.split(%r{\n}).map do |line|
15+
next if line.start_with?('Listing plugins')
1516
raise Puppet::Error, "Cannot parse invalid plugins line: #{line}" unless line =~ %r{^(\S+)$}
1617

1718
new(name: Regexp.last_match(1))

spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
provider.create
2323
end
2424

25+
context 'with RabbitMQ version >=3.10.0' do
26+
it 'matches plugins' do
27+
provider.expects(:rabbitmqplugins).with('list', '-E', '-m').returns <<~EOT
28+
Listing plugins with pattern ".*" ...
29+
foo
30+
EOT
31+
expect(provider.exists?).to eq(true)
32+
end
33+
end
34+
2535
context 'with RabbitMQ version >=3.4.0' do
2636
it 'calls rabbitmqplugins to enable' do
2737
provider.class.expects(:rabbitmq_version).returns '3.4.0'

0 commit comments

Comments
 (0)