Skip to content

Commit e62ca99

Browse files
committed
Fixed dockerpy 2.1.0's bug for docker error statuscode
1 parent 89cde0b commit e62ca99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apis/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ def docker_network_exists(name):
215215
cli.inspect_network(name)
216216
except docker.errors.APIError as e:
217217
# Forward compatibility for some exceptions raise.
218-
if e.status_code == 404:
218+
# Fixed bug for docker 2.1.0 e.status_code (ugly)
219+
if e.response is not None and e.response.status_code == 404:
219220
return False
220221
raise e
221222
return True

0 commit comments

Comments
 (0)