knife-setup 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -142,9 +142,9 @@ class Chef
142
142
  end
143
143
 
144
144
  def get_node
145
- node = Chef::Node.load(@node_name)
145
+ node = Chef::Node.load(server_name)
146
146
  if node.nil?
147
- ui.error("Could not find a node named #{@node_name}")
147
+ ui.error("Could not find a node named #{@server_name}")
148
148
  exit 1
149
149
  end
150
150
  return node
@@ -199,13 +199,17 @@ class Chef
199
199
  end
200
200
 
201
201
  def server_name
202
- Array(@name_args).first
202
+ if config[:chef_node_name].empty?
203
+ Array(@name_args).first
204
+ else
205
+ config[:chef_node_name]
206
+ end
203
207
  end
204
208
 
205
209
  def knife_ssh(command)
206
210
  ssh = Chef::Knife::Ssh.new
207
211
  ssh.ui = ui
208
- ssh.name_args = [ server_name, command]
212
+ ssh.name_args = [ @node_name, command]
209
213
  ssh.config[:ssh_user] = config[:ssh_user]
210
214
  ssh.config[:ssh_password] = config[:ssh_password]
211
215
  ssh.config[:ssh_port] = Chef::Config[:knife][:ssh_port] || config[:ssh_port]
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Setup
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-setup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-15 00:00:00.000000000 Z
12
+ date: 2013-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -66,3 +66,4 @@ signing_key:
66
66
  specification_version: 3
67
67
  summary: Setup chef on machine.
68
68
  test_files: []
69
+ has_rdoc: