Skip to content

Commit f37a2b0

Browse files
author
Warren Bain
committed
More flexibility around ssh port configuration
* ssh_port can come from stack server definition, config line, the knife config file and defaults to 22 if none provided * also only output actions message if there are actions to do
1 parent f024957 commit f37a2b0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/chef/knife/cs_stack_create.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def create_server(server)
118118
cmd.config[:cloudstack_project] = config[:cloudstack_project]
119119
cmd.config[:ssh_user] = config[:ssh_user]
120120
cmd.config[:ssh_password] = config[:ssh_password]
121-
cmd.config[:ssh_port] = config[:ssh_port] || Chef::Config[:knife][:ssh_port] || "22"
121+
cmd.config[:ssh_port] = server[:ssh_port] || locate_config_value(:ssh_port) || "22"
122122
cmd.config[:identity_file] = config[:identity_file]
123123
cmd.config[:keypair] = server[:keypair]
124124
cmd.config[:cloudstack_template] = server[:template] if server[:template]
@@ -143,6 +143,7 @@ def create_server(server)
143143
end
144144

145145
def run_actions(actions)
146+
return if actions.nil? || actions.empty?
146147
puts "\n"
147148
ui.msg("Processing actions...")
148149
sleep 1 # pause for e.g. chef solr indexing

0 commit comments

Comments
 (0)