Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing issue #236

cluster ssh was broken for VPC instances, this will fix a few bugs.
  • Loading branch information...
commit f89b88eff00cfcda5006e7a6d1220dfdacabd67b 1 parent 81dcf60
Wilton Marranzini authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/chef/knife/cluster_ssh.rb
View
6 lib/chef/knife/cluster_ssh.rb
@@ -50,8 +50,12 @@ def configure_session
# config[:identity_file] ||= target.ssh_identity_file
# @action_nodes = target.chef_nodes
+ #action_nodes needs to be an Array or chef will fail with nil:NilClass Exception
+ @action_nodes = []
target = target.select {|t| not t.bogus? }
- addresses = target.map {|c| c.machine.public_hostname }.compact
+ #For some reason the ssh_identity_file config above was removed from target.
+ config[:identity_file] ||= target.map {|c| c.keypair.key_filename }.compact.first
+ 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!"); exit 10) if addresses.nil? || addresses.length == 0
Please sign in to comment.
Something went wrong with that request. Please try again.