lib/chef/knife/ec2_server_create.rb in knife-ec2-1.0.25 vs lib/chef/knife/ec2_server_create.rb in knife-ec2-1.0.26
- old
+ new
@@ -390,13 +390,10 @@
if Chef::Config[:knife][:validation_key_url]
download_validation_key(validation_key_path)
Chef::Config[:validation_key] = validation_key_path
end
- config[:connection_protocol] ||= connection_protocol_ec2
- config[:connection_port] ||= connection_port
-
# Check if Server is Windows or Linux
if is_image_windows?
if winrm?
print "\n#{ui.color("Waiting for winrm access to become available", :magenta)}"
print(".") until tcp_test_winrm(connection_host, connection_port) do
@@ -572,9 +569,16 @@
def vpc_mode?
# Amazon Virtual Private Cloud requires a subnet_id. If
# present, do a few things differently
!!config_value(:subnet_id)
+ end
+
+ # When options connection_protocol and connection_port are not provided
+ # It will set as default
+ def plugin_setup!
+ config[:connection_protocol] ||= connection_protocol_ec2
+ config[:connection_port] ||= connection_port
end
def validate_name_args!
# We don't know the name of our instance yet
end