File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 16
16
import socket
17
17
import sys
18
18
import time
19
- import urllib2
20
- import httplib
21
19
22
- from command import Command
20
+ from . command import Command
23
21
24
22
25
23
def getLocalIp ():
@@ -38,12 +36,16 @@ def waitForSshTunnelInit(retries=20, delay=1.0):
38
36
for _ in range (retries ):
39
37
time .sleep (delay )
40
38
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 ()
45
47
46
- if response . getcode () == 200 :
48
+ if not sshCheckCommandResult . failed () :
47
49
return True
48
50
49
51
return False
You can’t perform that action at this time.
0 commit comments