#configure_session ⇒ Object

# File 'lib/chef/knife/cluster_ssh.rb', line 47defconfigure_sessiontarget=get_slice(@name_args[0]).select(&:running?)display(target)ifconfig[:verbose]||config[:display_target]config[:attribute]||=Chef::Config[:knife][:ssh_address_attribute]||"fqdn"config[:ssh_user]||=Chef::Config[:knife][:ssh_user]target=target.select{|t|nott.bogus?}addresses=target.map{|c|c.machine.vpc_id.nil??c.machine.public_hostname:c.machine.public_ip_address}.compact(ui.fatal("No nodes returned from search!");exit10)ifaddresses.nil?||addresses.length==0# Need to include both public host and public ip; sometimes these are different
@hostname_to_ironfan_hostname=target.to_a.inject({})do|remap,c|remap[c.machine.public_hostname]=c.machine.tags['Name']||c.nameremap[c.machine.public_ip_address]=c.machine.tags['Name']||c.nameremapend@longest_ironfan_hostname=@hostname_to_ironfan_hostname.values.group_by(&:size).max.last[0].size@action_nodes=Chef::Search::Query.new.search(:node,"node_name:#{@name_args[0]}*")[0]session_from_list(addresses)end