<commit_before># Install RabbitMQ plugins
#
# NOTE: I think rabbitmq_plugin should be defined as resource like gem_package.
#

# FIXME: this constant should be define dynamically.
CMD_PATH = '/usr/lib/rabbitmq/bin'

default_plugins = %w( rabbitmq_management rabbitmq_management_visualiser )

node_plugins =
  if !node[:rabbitmq].nil? && !node[:rabbitmq][:plugins].nil?
    node[:rabbitmq][:plugins]
  else
    []
  end

(default_plugins.concat(node_plugins).uniq.sort).each do |name|
  execute "enable rabbitmq '#{name}' plugin" do
    command "#{CMD_PATH}/rabbitmq-plugins enable #{name}"
    not_if "#{CMD_PATH}/rabbitmq-plugins list | grep '#{name} ' | grep -i '[E]'"
    notifies :restart, 'service[rabbitmq-server]'
  end
end<commit_msg>fix not_if condition for rabbitmq_plugin<commit_after># Install RabbitMQ plugins
#
# NOTE: I think rabbitmq_plugin should be defined as resource like gem_package.
#

# FIXME: this constant should be define dynamically.
CMD_PATH = '/usr/lib/rabbitmq/bin'

node_plugins =
  if !node[:rabbitmq].nil? && !node[:rabbitmq][:plugins].nil?
    node[:rabbitmq][:plugins]
  else
    []
  end

(node_plugins.uniq.sort).each do |name|
  execute "enable rabbitmq '#{name}' plugin" do
    command "#{CMD_PATH}/rabbitmq-plugins enable #{name}"
    not_if "#{CMD_PATH}/rabbitmq-plugins list | grep '#{name} ' | grep -iv '[E]'"
    notifies :restart, 'service[rabbitmq-server]'
  end
end
{'fraction_non_alphanumeric': 0.1395184135977337, 'fraction_numerical': 0.0, 'mean_word_length': 4.720647773279352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7239469', 'n_tokens_mistral': 495, 'n_tokens_neox': 462, 'n_words': 121}