Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docker_push_ssh/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ def waitForSshTunnelInit(retries=20, delay=1.0):
for _ in range(retries):
time.sleep(delay)

try:
response = urllib2.urlopen("http://localhost:5000/v2/", timeout=5)
except (socket.error, urllib2.URLError, httplib.BadStatusLine):
continue
sshCheckCommandResult = Command("docker", [
"exec",
"docker-push-ssh-tunnel",
"wget",
"-O", "/dev/null",
"-q",
"--timeout=5",
"http://localhost:5000/v2"
]).environment_dict(os.environ).execute()

if response.getcode() == 200:
if not sshCheckCommandResult.failed():
return True

return False
Expand Down