lib/chef/knife/bootstrap_windows_winrm.rb in knife-windows-1.0.0.rc.0 vs lib/chef/knife/bootstrap_windows_winrm.rb in knife-windows-1.0.0.rc.1

- old
+ new

@@ -87,13 +87,17 @@ # the same as the case where we encounter an exception. status = run_command("echo . & echo Response received.") raise RuntimeError, 'Command execution failed.' if status != 0 ui.info(ui.color("Remote node responded after #{elapsed_time_in_minutes(wait_start_time)} minutes.", :magenta)) return - rescue + rescue Errno::ECONNREFUSED => e + ui.error("Connection refused connecting to #{locate_config_value(:server_name)}:#{locate_config_value(:winrm_port)}.") + raise + rescue Exception => e retries_left -= 1 if retries_left <= 0 || (elapsed_time_in_minutes(wait_start_time) > wait_max_minutes) ui.error("No response received from remote node after #{elapsed_time_in_minutes(wait_start_time)} minutes, giving up.") + ui.error("Exception: #{e.message}") raise end print '.' sleep retry_interval_seconds retry