Skip to content

Commit cab923c

Browse files
committed
RD-2020 Fix network check to the exact name
1 parent 3a41f5e commit cab923c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

skipper/runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import getpass
33
import grp
44
import logging
5+
import re
56
import os
67
import subprocess
78
from contextlib import contextmanager
@@ -250,8 +251,8 @@ def _destroy_network(net):
250251

251252
def _network_exists(net):
252253
cmd = ['network', 'ls', "-f", f"NAME={net}"]
253-
result = utils.run_container_command(cmd)
254-
return net in result
254+
result = utils.run_container_command(cmd).decode('utf-8')
255+
return bool(re.search(rf'\b{net}\b', result))
255256

256257

257258
def get_docker_config_volume_suffix():

0 commit comments

Comments
 (0)