mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Fix rabbitmq_plugin.py: broken prefix path
This commit is contained in:
committed by
Matt Clay
parent
334b13b814
commit
c42b8b4ad7
@@ -59,12 +59,23 @@ EXAMPLES = '''
|
|||||||
- rabbitmq_plugin: names=rabbitmq_management state=enabled
|
- rabbitmq_plugin: names=rabbitmq_management state=enabled
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
class RabbitMqPlugins(object):
|
class RabbitMqPlugins(object):
|
||||||
def __init__(self, module):
|
def __init__(self, module):
|
||||||
self.module = module
|
self.module = module
|
||||||
|
|
||||||
if module.params['prefix']:
|
if module.params['prefix']:
|
||||||
self._rabbitmq_plugins = module.params['prefix'] + "/sbin/rabbitmq-plugins"
|
if os.path.isdir(os.path.join(module.params['prefix'], 'bin')):
|
||||||
|
bin_path = os.path.join(module.params['prefix'], 'bin')
|
||||||
|
elif os.path.isdir(os.path.join(module.params['prefix'], 'sbin')):
|
||||||
|
bin_path = os.path.join(module.params['prefix'], 'sbin')
|
||||||
|
else:
|
||||||
|
# No such path exists.
|
||||||
|
raise Exception("No binary folder in RabbitMQ prefix")
|
||||||
|
|
||||||
|
self._rabbitmq_plugins = bin_path + "/rabbitmq-plugins"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self._rabbitmq_plugins = module.get_bin_path('rabbitmq-plugins', True)
|
self._rabbitmq_plugins = module.get_bin_path('rabbitmq-plugins', True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user