diff options
author | asteroide <thomas.duval@orange.com> | 2017-07-25 17:39:17 +0200 |
---|---|---|
committer | asteroide <thomas.duval@orange.com> | 2017-07-25 17:39:17 +0200 |
commit | 025de97a3ba7ed570adfcadbfadadc14d7e57428 (patch) | |
tree | cf3373a6f6268aacae5f1150fb707e0847ebdf71 /moonv4/moon_utilities/moon_utilities/exceptions.py | |
parent | b7c121536061d823b6e2b5063db891405672b259 (diff) |
Update to get configuration from the consul
Change-Id: I9455f2415d3b67f26bb5ae2840c329caf779880f
Diffstat (limited to 'moonv4/moon_utilities/moon_utilities/exceptions.py')
-rw-r--r-- | moonv4/moon_utilities/moon_utilities/exceptions.py | 38 |
1 files changed, 37 insertions, 1 deletions
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" + |