From 77d43564742d2cc6dd80a062c4cf01059b58580c Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Wed, 12 Dec 2012 04:55:18 +0100 Subject: [PATCH] Fix parsing of absolute job dependencies It seems that Python code generates (sometimes) absolute job dependencies which are strings, instead of integers, so we should be able to parse these as well. We simply change from explicit int-based parsing (makeJobId) to the generic one (parseJobId). Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Helga Velroyen <helgav@google.com> --- htools/Ganeti/Types.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htools/Ganeti/Types.hs b/htools/Ganeti/Types.hs index 0297412f7..208ae9d7f 100644 --- a/htools/Ganeti/Types.hs +++ b/htools/Ganeti/Types.hs @@ -437,9 +437,7 @@ instance JSON.JSON JobIdDep where case JSON.readJSON v::JSON.Result (Negative Int) of -- first try relative dependency, usually most common JSON.Ok r -> return $ JobDepRelative r - JSON.Error _ -> liftM JobDepAbsolute - (fromJResult "parsing absolute job id" (readJSON v) >>= - makeJobId) + JSON.Error _ -> liftM JobDepAbsolute (parseJobId v) -- | Job Dependency type. data JobDependency = JobDependency JobIdDep [FinalizedJobStatus] -- GitLab