Errors.hs: improve field names for ConfigVersionMismatch
authorDato Simó <dato@google.com>
Thu, 25 Oct 2012 16:11:12 +0000 (17:11 +0100)
committerDato Simó <dato@google.com>
Thu, 25 Oct 2012 17:57:13 +0000 (18:57 +0100)
Change {exp,act}Code to {exp,act}Ver, which gives a better idea that
the integer fields represent version numbers.

Also:

  - errors.py: update OpPrereqError's docstring to note that an error
    code is always expected as the second argument (it was previously
    optional).

Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

htools/Ganeti/Errors.hs
lib/errors.py

index 391e379..cd4c629 100644 (file)
@@ -67,8 +67,8 @@ $(genException "GanetiException"
   , ("ProgrammerError", [excErrMsg])
   , ("BlockDeviceError", [excErrMsg])
   , ("ConfigurationError", [excErrMsg])
-  , ("ConfigVersionMismatch", [ ("expCode", [t| Int |])
-                              , ("actCode", [t| Int |])])
+  , ("ConfigVersionMismatch", [ ("expVer", [t| Int |])
+                              , ("actVer", [t| Int |])])
   , ("ReservationError", [excErrMsg])
   , ("RemoteError", [excErrMsg])
   , ("SignatureError", [excErrMsg])
index 035df49..444c2d0 100644 (file)
@@ -169,8 +169,7 @@ class ResultValidationError(GenericError):
 class OpPrereqError(GenericError):
   """Prerequisites for the OpCode are not fulfilled.
 
-  This exception will have either one or two arguments. For the
-  two-argument construction, the second argument should be one of the
+  This exception has two arguments: an error message, and one of the
   ECODE_* codes.
 
   """