diff options
| author | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2016-07-15 16:48:42 +0200 |
|---|---|---|
| committer | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2016-08-30 07:34:33 +0000 |
| commit | 05dc46b0e3c008f9f83a576e59c74fd17735dfa9 (patch) | |
| tree | 716f91a338c593ecc072cac8127bdb741c213ce3 | |
| parent | 39252ba028012fd14e4e283217d842fb80206c52 (diff) | |
| download | git-repo-05dc46b0e3c008f9f83a576e59c74fd17735dfa9.tar.gz | |
Repo: improve error detection for new ssh connections
this check can only detect errors that happen within 1 sec after launching
ssh. But this is typically enough to catch configuration issues like
'connection refused' or 'authentication failed'.
Change-Id: I00b6f62d4c2889b1faa6c820e49a198554c92795
| -rw-r--r-- | git_config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git_config.py b/git_config.py index 0379181a..3fc56b68 100644 --- a/git_config.py +++ b/git_config.py | |||
| @@ -464,9 +464,13 @@ def _open_ssh(host, port=None): | |||
| 464 | % (host,port, str(e)), file=sys.stderr) | 464 | % (host,port, str(e)), file=sys.stderr) |
| 465 | return False | 465 | return False |
| 466 | 466 | ||
| 467 | time.sleep(1) | ||
| 468 | ssh_died = (p.poll() is not None) | ||
| 469 | if ssh_died: | ||
| 470 | return False | ||
| 471 | |||
| 467 | _master_processes.append(p) | 472 | _master_processes.append(p) |
| 468 | _master_keys.add(key) | 473 | _master_keys.add(key) |
| 469 | time.sleep(1) | ||
| 470 | return True | 474 | return True |
| 471 | finally: | 475 | finally: |
| 472 | _master_keys_lock.release() | 476 | _master_keys_lock.release() |
