Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Chef::Knife::ClientReregister

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/client_reregister.rb, line 37
def run
  @client_name = @name_args[0]

  if @client_name.nil?
    show_usage
    ui.fatal("You must specify a client name")
    exit 1
  end

  client = Chef::ApiClient.reregister(@client_name)
  Chef::Log.debug("Updated client data: #{client.inspect}")
  key = client.private_key
  if config[:file]
    File.open(config[:file], "w") do |f|
      f.print(key)
    end
  else
    ui.msg key
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.