Handle error if node hasn't started yet

This commit is contained in:
Bruno Alla 2021-01-28 09:19:14 +00:00 committed by GitHub
parent 26a424e09c
commit 9969f8fa0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,8 +70,12 @@ if env("USE_DOCKER") == "yes":
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
{%- if cookiecutter.js_task_runner == 'Gulp' %} {%- if cookiecutter.js_task_runner == 'Gulp' %}
_, _, ips = socket.gethostbyname_ex("node") try:
INTERNAL_IPS.extend(ips) _, _, ips = socket.gethostbyname_ex("node")
INTERNAL_IPS.extend(ips)
except socket.gaierror:
# The node container isn't started (yet?)
pass
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}