From df15627716cc16aacbc577c4328fc186d7e7637d Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 15 Feb 2011 13:35:22 +0100
Subject: [PATCH] errors: Add list of possible failure types

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/errors.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/errors.py b/lib/errors.py
index 7df228592..06bd9e540 100644
--- a/lib/errors.py
+++ b/lib/errors.py
@@ -43,6 +43,19 @@ ECODE_FAULT = "internal_error"
 # environment error (e.g. node disk error)
 ECODE_ENVIRON = "environment_error"
 
+#: List of all failure types
+ECODE_ALL = frozenset([
+  ECODE_RESOLVER,
+  ECODE_NORES,
+  ECODE_INVAL,
+  ECODE_STATE,
+  ECODE_NOENT,
+  ECODE_EXISTS,
+  ECODE_NOTUNIQUE,
+  ECODE_FAULT,
+  ECODE_ENVIRON,
+  ])
+
 
 class GenericError(Exception):
   """Base exception for Ganeti.
-- 
GitLab