# File lib/chef/chef_fs/knife.rb, line 76 def chef_fs @chef_fs_config.chef_fs end
# File lib/chef/chef_fs/knife.rb, line 58 def configure_chef super Chef::Config[:repo_mode] = config[:repo_mode] if config[:repo_mode] Chef::Config[:concurrency] = config[:concurrency].to_i if config[:concurrency] # --chef-repo-path forcibly overrides all other paths if config[:chef_repo_path] Chef::Config[:chef_repo_path] = config[:chef_repo_path] %(acl client cookbook container data_bag environment group node role user).each do |variable_name| Chef::Config.delete("#{variable_name}_path".to_sym) end end @chef_fs_config = Chef::ChefFS::Config.new(Chef::Config, Dir.pwd, config) Chef::ChefFS::Parallelizer.threads = (Chef::Config[:concurrency] || 10) - 1 end
# File lib/chef/chef_fs/knife.rb, line 80 def create_chef_fs @chef_fs_config.create_chef_fs end
# File lib/chef/chef_fs/knife.rb, line 88 def create_local_fs @chef_fs_config.create_local_fs end
# File lib/chef/chef_fs/knife.rb, line 119 def discover_repo_dir(dir) %(.chef cookbooks data_bags environments roles).each do |subdir| return dir if File.directory?(File.join(dir, subdir)) end # If this isn't it, check the parent parent = File.dirname(dir) if parent && parent != dir discover_repo_dir(parent) else nil end end
# File lib/chef/chef_fs/knife.rb, line 111 def format_path(entry) @chef_fs_config.format_path(entry) end
# File lib/chef/chef_fs/knife.rb, line 84 def local_fs @chef_fs_config.local_fs end
# File lib/chef/chef_fs/knife.rb, line 115 def parallelize(inputs, options = {}, &block) Chef::ChefFS::Parallelizer.parallelize(inputs, options, &block) end
# File lib/chef/chef_fs/knife.rb, line 100 def pattern_arg_from(arg) # TODO support absolute file paths and not just patterns? Too much? # Could be super useful in a world with multiple repo paths if !@chef_fs_config.base_path && !Chef::ChefFS::PathUtils.is_absolute?(arg) # Check if chef repo path is specified to give a better error message ui.error("Attempt to use relative path '#{arg}' when current directory is outside the repository path") exit(1) end Chef::ChefFS::FilePattern.relative_to(@chef_fs_config.base_path, arg) end
Generated with the Darkfish Rdoc Generator 2.