Skip to content

Commit

Permalink
catch Errno::ETIMEDOUT in distribute_key_to_host method
Browse files Browse the repository at this point in the history
  • Loading branch information
jkim committed Jan 17, 2017
1 parent 1511495 commit 611c5b7
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -127,6 +127,7 @@ def get_environment(deployment, config_dir)

def distribute_public_key(deployment)
keyutils = Utils::Fusor::SSHKeyUtils.new(deployment)
fail _("keyutils is NIL!") if keyutils.nil?

if !deployment.rhev_is_self_hosted
distribute_key_to_host keyutils, deployment.rhev_engine_host.name, deployment.rhev_root_password
Expand All @@ -142,7 +143,7 @@ def distribute_key_to_host(keyutils, host, password)
time_to_sleep = 30
tries ||= 10
keyutils.copy_keys_to_root host, password
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Net::SCP::Error
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ETIMEDOUT, Net::SCP::Error
::Fusor.log.debug "======= SSH is not yet available on host #{host}, #{tries - 1} retries remaining ======"
if (tries -= 1) > 0
::Fusor.log.debug "====== Sleeping for #{time_to_sleep} seconds"
Expand Down

0 comments on commit 611c5b7

Please sign in to comment.