<commit_before>#
# Author:: <NAME> (<<EMAIL>>)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
#
# All Rights Reserved

cookbook_migration = "/opt/opscode/embedded/bin/cookbook_migration.sh"

checksum_path = node['private_chef']['opscode-chef']['checksum_path']
data_path = node['private_chef']['bookshelf']['data_dir']

owner = node['private_chef']['user']['username']
group = owner

template cookbook_migration do
  source "cookbook_migration.sh.erb"
  owner "root"
  group "root"
  mode "0755"
end

execute "cookbook migration" do
  command cookbook_migration
  only_if { File.exist?(checksum_path) && !File.exist?(data_path) }
end

execute "reset bookshelf data owner" do
  command "chown -R #{owner} #{data_path}"
  only_if { File.exist?(data_path) }
end

execute "reset bookshelf data group" do
  command "chgrp -R #{group} #{data_path}"
  only_if { File.exist?(data_path) }
end

bookshelf_dir = node['private_chef']['bookshelf']['dir']
bookshelf_etc_dir = File.join(bookshelf_dir, "etc")
bookshelf_log_dir = node['private_chef']['bookshelf']['log_directory']
bookshelf_sasl_log_dir = File.join(bookshelf_log_dir, "sasl")
bookshelf_data_dir = node['private_chef']['bookshelf']['data_dir']
[<commit_msg>Remove recursive chown, run migration as opscode user.<commit_after>#
# Author:: <NAME> (<<EMAIL>>)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
#
# All Rights Reserved

cookbook_migration = "/opt/opscode/embedded/bin/cookbook_migration.sh"

checksum_path = node['private_chef']['opscode-chef']['checksum_path']
data_path = node['private_chef']['bookshelf']['data_dir']

owner = node['private_chef']['user']['username']
group = owner

template cookbook_migration do
  source "cookbook_migration.sh.erb"
  owner "root"
  group "root"
  mode "0755"
end

execute "cookbook migration" do
  command cookbook_migration
  user owner
  only_if { File.exist?(checksum_path) && !File.exist?(data_path) }
end

bookshelf_dir = node['private_chef']['bookshelf']['dir']
bookshelf_etc_dir = File.join(bookshelf_dir, "etc")
bookshelf_log_dir = node['private_chef']['bookshelf']['log_directory']
bookshelf_sasl_log_dir = File.join(bookshelf_log_dir, "sasl")
bookshelf_data_dir = node['private_chef']['bookshelf']['data_dir']
[
{'fraction_non_alphanumeric': 0.15419296663660956, 'fraction_numerical': 0.007213706041478809, 'mean_word_length': 7.1881918819188195, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2495426', 'n_tokens_mistral': 817, 'n_tokens_neox': 785, 'n_words': 151}