<commit_before>#
# Copyright:: Copyright (c) 2014 Opscode, Inc.
#
# All Rights Reserved
#

add_command "upgrade", "Upgrade your private chef installation. Add the '--no-op' flag to see what *would* be upgraded", 1 do
  use_why_run_mode = ARGV.include?("--no-op")

  # Our upgrade process is really just a special chef run
  command = ["chef-solo",
             "--config #{base_path}/embedded/cookbooks/solo.rb",
             "--json-attributes #{base_path}/embedded/cookbooks/pre_upgrade_setup.json",
             "--log_level fatal"] # yes, that's an underscore in log_level
  command << "--why-run" if use_why_run_mode
  status = run_command(command.join(" "))
  exit! 1 unless status.success?
  reconfigure(false)
end<commit_msg>Automate the stop and restart before/after the upgrade command<commit_after>#
# Copyright:: Copyright (c) 2014 Opscode, Inc.
#
# All Rights Reserved
#

add_command "upgrade", "Upgrade your private chef installation. Add the '--no-op' flag to see what *would* be upgraded", 1 do
  use_why_run_mode = ARGV.include?("--no-op")

  # Our upgrade process is really just a special chef run
  status = run_command('chef-server-ctl stop')
  exit! 1 unless status.success?
  command = ["chef-solo",
             "--config #{base_path}/embedded/cookbooks/solo.rb",
             "--json-attributes #{base_path}/embedded/cookbooks/pre_upgrade_setup.json",
             "--log_level fatal"] # yes, that's an underscore in log_level
  command << "--why-run" if use_why_run_mode
  status = run_command(command.join(" "))
  exit! 1 unless status.success?
  reconfigure(false)
  status = run_command('chef-server-ctl restart')
  exit! 1 unless status.success?
end
{'fraction_non_alphanumeric': 0.1293206197854589, 'fraction_numerical': 0.00834326579261025, 'mean_word_length': 3.6126373626373627, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5513965', 'n_tokens_mistral': 550, 'n_tokens_neox': 517, 'n_words': 155}