Skip to content

Commit

Permalink
Merge pull request #407 from grycap/devel
Browse files Browse the repository at this point in the history
Campture SSH errors in wait_ssh_access
  • Loading branch information
micafer authored Sep 14, 2017
2 parents 3125ce2 + 2e12507 commit 1e116e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion contextualization/ctxt_agent_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def wait_ssh_access(vm, delay=10, max_wait=None, quiet=False):
res = "new"
except AuthenticationException:
try_ansible_key = True
except:
if not quiet:
CtxtAgent.logger.exception("Error connecting with SSH with: " + vm_ip)
success = False

if try_ansible_key:
# In some very special cases the last two cases fail, so check
Expand All @@ -150,8 +154,13 @@ def wait_ssh_access(vm, delay=10, max_wait=None, quiet=False):
success = ssh_client.test_connectivity()
res = 'pk_file'
except:
CtxtAgent.logger.exception("Error connecting with SSH with: " + vm_ip)
if not quiet:
CtxtAgent.logger.exception("Error connecting with SSH with: " + vm_ip)
success = False
except:
if not quiet:
CtxtAgent.logger.exception("Error connecting with SSH with: " + vm_ip)
success = False

if success:
vm['ctxt_ip'] = vm_ip
Expand Down

0 comments on commit 1e116e5

Please sign in to comment.