Skip to content

Commit f8bd2d8

Browse files
committed
add a workaround for rabbitmq_vhost when running with --noop or --tags
This fixes the error: Error: Could not prefetch rabbitmq_vhost provider 'rabbitmqctl': Command rabbitmqctl is missing The problem, and the workaround, are the same as that described in commit 8a3a27a, "add a workaround for running with --noop or --tags". This is necessary because the original workaround is for rabbitmqctl_list(), whereas rabbitmq_version() calls rabbitmqctl() directly. Other callers of rabbitmq_version() should not need this workaround, since they are not run in a state where rabbitmq itself is not yet installed.
1 parent 175d556 commit f8bd2d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/puppet/provider/rabbitmq_vhost/rabbitmqctl.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def self.prefetch(resources)
1919
# we only deal with vhost metadata >= version 3.11.0
2020
def self.supports_metadata?
2121
Puppet::Util::Package.versioncmp(rabbitmq_version, '3.11') >= 0
22+
rescue Puppet::MissingCommand
23+
# See comment on the definition of rabbitmqctl_list in rabbitmqctl_cli.rb;
24+
# the same rationale applies here.
25+
Puppet.debug('supports_metadata?: rabbitmqctl command not found; assuming rabbitmq is not installed')
26+
false
2227
end
2328

2429
def supports_metadata?

0 commit comments

Comments
 (0)