def _get_rabbitmq_plugin():
 rabbitmq = __context__.get('rabbitmq-plugins')
 if (rabbitmq is None):
  version = __salt__['pkg.version']('rabbitmq-server').split('-')[0]
  rabbitmq = '/usr/lib/rabbitmq/lib/rabbitmq_server-{0}/sbin/rabbitmq-plugins'.format(version)
  __context__['rabbitmq-plugins'] = rabbitmq
 return rabbitmq

def _get_rabbitmq_plugin ( ) : rabbitmq = __context__ . get ( 'rabbitmq-plugins' ) if ( rabbitmq is None ) : version = __salt__ [ 'pkg.version' ] ( 'rabbitmq-server' ) . split ( '-' ) [ 0 ] rabbitmq = '/usr/lib/rabbitmq/lib/rabbitmq_server-{0}/sbin/rabbitmq-plugins' . format ( version ) __context__ [ 'rabbitmq-plugins' ] = rabbitmq return rabbitmq
returns the rabbitmq-plugin command path if were running an os that doesnt put it in the standard /usr/bin or /usr/local/bin this works by taking the rabbitmq-server version and looking for where it seems to be hidden in /usr/lib .