From 86a2496966517d34642270af381dcfe2bf61592d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dato=20Sim=C3=B3?= <dato@google.com> Date: Thu, 25 Oct 2012 17:11:12 +0100 Subject: [PATCH] Errors.hs: improve field names for ConfigVersionMismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 4 ++-- lib/errors.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htools/Ganeti/Errors.hs b/htools/Ganeti/Errors.hs index 391e37986..cd4c62948 100644 --- a/htools/Ganeti/Errors.hs +++ b/htools/Ganeti/Errors.hs @@ -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]) diff --git a/lib/errors.py b/lib/errors.py index 035df4972..444c2d082 100644 --- a/lib/errors.py +++ b/lib/errors.py @@ -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. """ -- GitLab