#NEWLINE# def plugin_is_enabled( name , runas = None ) : #NEWLINE# #INDENT# "\n    Return whether the plugin is enabled.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' rabbitmq.plugin_is_enabled foo\n    " #NEWLINE# if ( runas is None ) : #NEWLINE# #INDENT# runas = salt . utils . get_user ( ) #NEWLINE# #UNINDENT# cmd = [ _get_rabbitmq_plugin ( ) , 'list' , '-m' , '-e' ] #NEWLINE# ret = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = False , runas = runas ) #NEWLINE# if ( ret [ 'retcode' ] != 0 ) : #NEWLINE# #INDENT# raise CommandExecutionError ( 'RabbitMQ command failed: {0}' . format ( ret [ 'stderr' ] ) ) #NEWLINE# #UNINDENT# return bool ( ( name in ret [ 'stdout' ] ) )