Skip to content
Closed
Show file tree
Hide file tree
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
18 changes: 10 additions & 8 deletions docker_push_ssh/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
import socket
import sys
import time
import urllib2
import httplib

from command import Command
from .command import Command


def getLocalIp():
Expand All @@ -38,12 +36,16 @@ 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",
"http://localhost:5000/v2"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add --timeout=5 to the wget args to match the previous behavior

]).environment_dict(os.environ).execute()

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

return False
Expand Down
2 changes: 1 addition & 1 deletion docker_push_ssh/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def environment(self, key, value):
return self

def environment_dict(self, env_dict):
for key, value in env_dict.iteritems():
for key, value in env_dict.items():
self.environment_variables[key] = value
return self

Expand Down