File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import socket
1717import sys
1818import time
19- import urllib2
20- import httplib
2119
22- from command import Command
20+ from . command import Command
2321
2422
2523def getLocalIp ():
@@ -38,12 +36,16 @@ def waitForSshTunnelInit(retries=20, delay=1.0):
3836 for _ in range (retries ):
3937 time .sleep (delay )
4038
41- try :
42- response = urllib2 .urlopen ("http://localhost:5000/v2/" , timeout = 5 )
43- except (socket .error , urllib2 .URLError , httplib .BadStatusLine ):
44- continue
39+ sshCheckCommandResult = Command ("docker" , [
40+ "exec" ,
41+ "docker-push-ssh-tunnel" ,
42+ "wget" ,
43+ "-O" , "/dev/null" ,
44+ "-q" ,
45+ "http://localhost:5000/v2"
46+ ]).environment_dict (os .environ ).execute ()
4547
46- if response . getcode () == 200 :
48+ if not sshCheckCommandResult . failed () :
4749 return True
4850
4951 return False
You can’t perform that action at this time.
0 commit comments