Skip to content

Commit

Permalink
Merge pull request ansible#133 from pcarinhas/devel
Browse files Browse the repository at this point in the history
Fix rabbitmq_plugin.py: broken prefix path
  • Loading branch information
bcoca committed Aug 18, 2015
2 parents 29383c3 + 530323b commit 1dce033
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion messaging/rabbitmq_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,24 @@
- rabbitmq_plugin: names=rabbitmq_management state=enabled
'''

import os

class RabbitMqPlugins(object):
def __init__(self, module):
self.module = module

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 prefix %s" %
module.params['prefix'])

self._rabbitmq_plugins = bin_path + "/rabbitmq-plugins"

else:
self._rabbitmq_plugins = module.get_bin_path('rabbitmq-plugins', True)

Expand Down

0 comments on commit 1dce033

Please sign in to comment.