@@ -89,7 +89,7 @@ def isRunning(self):
89
89
runStatus ["image" ] = runContainer .image .attrs ["RepoTags" ][0 ]
90
90
except IndexError :
91
91
runStatus ["image" ] = runContainer .image .attrs ["Id" ]
92
- except docker .errors .NotFound :
92
+ except ( docker .errors .NotFound , requests . exceptions . ChunkedEncodingError ) :
93
93
pass
94
94
return runStatus
95
95
@@ -99,7 +99,7 @@ def getSshCommand(self):
99
99
try :
100
100
attrs = self .cli .containers .get (self .conf ["dockName" ]).attrs
101
101
sshPort = attrs ["NetworkSettings" ]["Ports" ]["22/tcp" ][0 ]["HostPort" ]
102
- except (docker .errors .NotFound , KeyError ) as exc :
102
+ except (docker .errors .NotFound , KeyError , requests . exceptions . ChunkedEncodingError ) as exc :
103
103
outLog = os .path .join (outPath , "log.txt" )
104
104
try :
105
105
with open (outLog , "a+" ):
@@ -152,7 +152,7 @@ def shell(self, cmd=None):
152
152
try :
153
153
attrs = self .cli .containers .get (self .conf ["dockName" ]).attrs
154
154
xPort = attrs ["NetworkSettings" ]["Ports" ]["14500/tcp" ][0 ]["HostPort" ]
155
- except (docker .errors .NotFound , KeyError ):
155
+ except (docker .errors .NotFound , KeyError , requests . exceptions . ChunkedEncodingError ):
156
156
xPort = None
157
157
if not xPort and platform .system () == "Windows" and "DISPLAY" not in os .environ :
158
158
# On Windows if no DISPLAY environment is set we assume a sensible default
@@ -304,7 +304,7 @@ def run(self):
304
304
def stop (self ):
305
305
try :
306
306
self .cli .containers .get (self .conf ["dockName" ]).remove (force = True )
307
- except docker .errors .NotFound :
307
+ except ( docker .errors .NotFound , requests . exceptions . ChunkedEncodingError ) :
308
308
pass # final state is fine, container is gone
309
309
310
310
def pull (self ):
0 commit comments