class Chef::Knife::ClientKeyList

Implements knife user key list using Chef::Knife::KeyList as a service class.

@author Tyler Cloke

@attr_reader [String] actor the name of the client that this key is for

Attributes

actor[R]

Public Class Methods

new(argv = []) click to toggle source
Calls superclass method Chef::Knife::new
# File lib/chef/knife/client_key_list.rb, line 38
def initialize(argv = [])
  super(argv)
  @service_object = nil
end

Public Instance Methods

actor_missing_error() click to toggle source
# File lib/chef/knife/client_key_list.rb, line 52
def actor_missing_error
  "You must specify a client name"
end
apply_params!(params) click to toggle source
# File lib/chef/knife/client_key_list.rb, line 60
def apply_params!(params)
  @actor = params[0]
  if @actor.nil?
    show_usage
    ui.fatal(actor_missing_error)
    exit 1
  end
end
list_method() click to toggle source
# File lib/chef/knife/client_key_list.rb, line 48
def list_method
  :list_by_client
end
run() click to toggle source
# File lib/chef/knife/client_key_list.rb, line 43
def run
  apply_params!(@name_args)
  service_object.run
end
service_object() click to toggle source
# File lib/chef/knife/client_key_list.rb, line 56
def service_object
  @service_object ||= Chef::Knife::KeyList.new(@actor, list_method, ui, config)
end