class Chef::Knife::ClientKeyShow
Implements knife client key show using Chef::Knife::KeyShow
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_show.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_show.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_show.rb, line 64 def apply_params!(params) @actor = params[0] if @actor.nil? show_usage ui.fatal(actor_missing_error) exit 1 end @name = params[1] if @name.nil? show_usage ui.fatal(keyname_missing_error) exit 1 end end
keyname_missing_error()
click to toggle source
# File lib/chef/knife/client_key_show.rb, line 56 def keyname_missing_error "You must specify a key name" end
load_method()
click to toggle source
# File lib/chef/knife/client_key_show.rb, line 48 def load_method :load_by_client end
run()
click to toggle source
# File lib/chef/knife/client_key_show.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_show.rb, line 60 def service_object @service_object ||= Chef::Knife::KeyShow.new(@name, @actor, load_method, ui) end