Parent

Files

Class/Module Index [+]

Quicksearch

Chef::Knife::Serve

Public Instance Methods

configure_chef() click to toggle source
# File lib/chef/knife/serve.rb, line 18
def configure_chef
  super
  Chef::Config.local_mode = true
  Chef::Config[:repo_mode] = config[:repo_mode] if config[:repo_mode]

  # --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
end
run() click to toggle source
# File lib/chef/knife/serve.rb, line 32
def run
  begin
    server = Chef::Application.chef_zero_server
    output "Serving files from:\n#{server.options[:data_store].chef_fs.fs_description}"
    server.stop
    server.start(stdout) # to print header
  ensure
    server.stop
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.