Skip to content

Commit d20190d

Browse files
committed
Docker: Improve error messages around port-bound check
1 parent e1f3422 commit d20190d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

localstack-core/localstack/utils/docker_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,16 @@ def container_ports_can_be_bound(
154154
remove=True,
155155
)
156156
except Exception as e:
157-
if "port is already allocated" not in str(e) and "address already in use" not in str(e):
157+
if "address already in use" not in str(e):
158158
LOG.warning(
159-
"Unexpected error when attempting to determine container port status: %s", e
159+
"Unexpected error when attempting to determine container port status", exc_info=e
160160
)
161161
return False
162162
# TODO(srw): sometimes the command output from the docker container is "None", particularly when this function is
163163
# invoked multiple times consecutively. Work out why.
164164
if to_str(result[0] or "").strip() != "test123":
165165
LOG.warning(
166-
"Unexpected output when attempting to determine container port status: %s", result[0]
166+
"Unexpected output when attempting to determine container port status: %s", result
167167
)
168168
return True
169169

0 commit comments

Comments
 (0)