Update the dev_path on LVs on rename
[ganeti-local] / lib / errors.py
index 7bcd564..95125e9 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#
 #
 
 # Copyright (C) 2006, 2007 Google Inc.
@@ -104,8 +104,9 @@ class InvalidOS(GenericError):
   This is raised when an OS exists on the master (or is otherwise
   requested to the code) but not on the target node.
 
-  This exception has two arguments:
+  This exception has three arguments:
     - the name of the os
+    - the source directory, if any
     - the reason why we consider this an invalid OS (text of error message)
 
   """
@@ -129,11 +130,19 @@ class OpPrereqError(GenericError):
 
   """
 
+
 class OpExecError(GenericError):
   """Error during OpCode execution.
 
   """
 
+
+class OpRetryError(OpExecError):
+  """Error during OpCode execution, action can be retried.
+
+  """
+
+
 class OpCodeUnknown(GenericError):
   """Unknown opcode submitted.
 
@@ -142,6 +151,20 @@ class OpCodeUnknown(GenericError):
 
   """
 
+
+class ResolverError(GenericError):
+  """Host name cannot be resolved.
+
+  This is not a normal situation for Ganeti, as we rely on having a
+  working resolver.
+
+  The non-resolvable hostname is available as the first element of the
+  args tuple; the other two elements of the tuple are the first two
+  args of the socket.gaierror exception (error code and description).
+
+  """
+
+
 class HooksFailure(GenericError):
   """A generic hook failure.
 
@@ -149,6 +172,7 @@ class HooksFailure(GenericError):
 
   """
 
+
 class HooksAbort(HooksFailure):
   """A required hook has failed.
 
@@ -159,6 +183,7 @@ class HooksAbort(HooksFailure):
 
   """
 
+
 class UnitParseError(GenericError):
   """Unable to parse size unit.
 
@@ -168,3 +193,11 @@ class UnitParseError(GenericError):
 class SshKeyError(GenericError):
   """Invalid SSH key.
   """
+
+
+class TagError(GenericError):
+  """Generic tag error.
+
+  The argument to this exception will show the exact error.
+
+  """