From 025de97a3ba7ed570adfcadbfadadc14d7e57428 Mon Sep 17 00:00:00 2001 From: asteroide Date: Tue, 25 Jul 2017 17:39:17 +0200 Subject: Update to get configuration from the consul Change-Id: I9455f2415d3b67f26bb5ae2840c329caf779880f --- moonv4/moon_utilities/moon_utilities/exceptions.py | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'moonv4/moon_utilities/moon_utilities/exceptions.py') diff --git a/moonv4/moon_utilities/moon_utilities/exceptions.py b/moonv4/moon_utilities/moon_utilities/exceptions.py index f642fb57..ba5ecf46 100644 --- a/moonv4/moon_utilities/moon_utilities/exceptions.py +++ b/moonv4/moon_utilities/moon_utilities/exceptions.py @@ -5,7 +5,7 @@ from oslo_log import log as logging from werkzeug.exceptions import HTTPException -LOG = logging.getLogger(__name__) +LOG = logging.getLogger("moon.utilities.exceptions") _ = str @@ -475,6 +475,9 @@ class RuleUnknown(AdminRule): logger = "ERROR" +# Keystone exceptions + + class KeystoneError(MoonError): description = _("There is an error connecting to Keystone.") code = 400 @@ -503,3 +506,36 @@ class KeystoneUserConflict(KeystoneUserError): logger = "ERROR" +# Consul exceptions + + +class ConsulError(MoonError): + description = _("There is an error connecting to Consul.") + code = 400 + title = 'Consul error' + logger = "ERROR" + + +class ConsulComponentNotFound(ConsulError): + description = _("The component do not exist in Consul database.") + code = 500 + title = 'Consul error' + logger = "WARNING" + + +# Containers exceptions + + +class DockerError(MoonError): + description = _("There is an error with Docker.") + code = 400 + title = 'Docker error' + logger = "ERROR" + + +class ContainerMissing(DockerError): + description = _("Some containers are missing.") + code = 400 + title = 'Container missing' + logger = "ERROR" + -- cgit 1.2.3-korg