Display error messages when Docker is unreachable properly, related to #78

master
Pierre Jaury 8 years ago
parent fe8e25485d
commit c007b37df7

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block title %}
{% trans %}Docker error{% endtrans %}
{% endblock %}
{% block subtitle %}
{{ action }}
{% endblock %}
{% block box_content %}
<p>{% trans action %}An error occurred while talking to the Docker server.{% endtrans %}</p>
<pre>{{ error }}</pre>
{% endblock %}

@ -35,7 +35,11 @@ def logout():
@access.global_admin @access.global_admin
def services(): def services():
containers = {} containers = {}
for brief in dockercli.containers(all=True): try:
all_containers = dockercli.containers(all=True)
except Exception as error:
return flask.render_template('docker-error.html', error=error)
for brief in all_containers:
if brief['Image'].startswith('freeposte/'): if brief['Image'].startswith('freeposte/'):
container = dockercli.inspect_container(brief['Id']) container = dockercli.inspect_container(brief['Id'])
container['Image'] = dockercli.inspect_image(container['Image']) container['Image'] = dockercli.inspect_image(container['Image'])

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2016-10-02 17:33+0200\n" "POT-Creation-Date: 2016-10-13 09:28+0200\n"
"PO-Revision-Date: 2016-10-02 15:02+0200\n" "PO-Revision-Date: 2016-10-02 15:02+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n" "Language: en\n"
@ -182,6 +182,14 @@ msgstr ""
msgid "You are about to %(action)s. Please confirm your action." msgid "You are about to %(action)s. Please confirm your action."
msgstr "" msgstr ""
#: freeposte/admin/templates/docker-error.html:4
msgid "Docker error"
msgstr ""
#: freeposte/admin/templates/docker-error.html:12
msgid "An error occurred while talking to the Docker server."
msgstr ""
#: freeposte/admin/templates/login.html:6 #: freeposte/admin/templates/login.html:6
msgid "Your account" msgid "Your account"
msgstr "" msgstr ""

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2016-10-02 17:33+0200\n" "POT-Creation-Date: 2016-10-13 09:28+0200\n"
"PO-Revision-Date: 2016-10-02 16:32+0200\n" "PO-Revision-Date: 2016-10-02 16:32+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language: fr\n" "Language: fr\n"
@ -182,6 +182,14 @@ msgstr "Confirmer"
msgid "You are about to %(action)s. Please confirm your action." msgid "You are about to %(action)s. Please confirm your action."
msgstr "Vous allez %(action)s. Merci de confirmer votre action." msgstr "Vous allez %(action)s. Merci de confirmer votre action."
#: freeposte/admin/templates/docker-error.html:4
msgid "Docker error"
msgstr ""
#: freeposte/admin/templates/docker-error.html:12
msgid "An error occurred while talking to the Docker server."
msgstr ""
#: freeposte/admin/templates/login.html:6 #: freeposte/admin/templates/login.html:6
msgid "Your account" msgid "Your account"
msgstr "" msgstr ""

Loading…
Cancel
Save