diff options
-rw-r--r-- | lib/chef/knife/ssh.rb | 5 | ||||
-rw-r--r-- | spec/unit/knife/ssh_spec.rb | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index 78000aa273..01af582ee4 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -180,9 +180,8 @@ class Chef fqdns = list.map { |v| v[0] } if fqdns.count != fqdns.uniq.count duplicated_fqdns = fqdns.uniq - ui.fatal("SSH #{duplicated_fqdns.count > 1 ? 'nodes are' : 'node is'} " + - "duplicated: #{duplicated_fqdns.join(',')}") - exit 10 + ui.warn("SSH #{duplicated_fqdns.count > 1 ? 'nodes are' : 'node is'} " + + "duplicated: #{duplicated_fqdns.join(',')}") end session_from_list(list) end diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb index ecfca88924..c0ef9e4116 100644 --- a/spec/unit/knife/ssh_spec.rb +++ b/spec/unit/knife/ssh_spec.rb @@ -144,9 +144,8 @@ describe Chef::Knife::Ssh do @node_bar["fqdn"] = "foo.example.org" end - it "should raise a specific error" do - expect(@knife.ui).to receive(:fatal).with(/^SSH node is duplicated: foo\.example\.org/) - expect(@knife).to receive(:exit).with(10) + it "should be warned" do + expect(@knife.ui).to receive(:warn).with(/^SSH node is duplicated: foo\.example\.org/) expect(@knife).to receive(:session_from_list).with([ ["foo.example.org", nil, nil], ["foo.example.org", nil, nil], |