From 897b68a05f876d883abc8ac016a5fb385db53308 Mon Sep 17 00:00:00 2001 From: Uladzislau Harbuz Date: Fri, 15 Mar 2019 13:26:44 +0100 Subject: [PATCH] Fix resolving Weles API version by server version Signed-off-by: Uladzislau Harbuz Change-Id: I711aee019ff2e4e196c75da51577130ccbd4c036 --- Festral.cabal | 2 +- Festral/SLAV/Weles.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Festral.cabal b/Festral.cabal index fd082f8..d851a78 100644 --- a/Festral.cabal +++ b/Festral.cabal @@ -1,5 +1,5 @@ Name: Festral -Version: 1.5.0 +Version: 1.5.1 Cabal-Version: >= 1.2 License: Apache-2.0 License-file: LICENSE diff --git a/Festral/SLAV/Weles.hs b/Festral/SLAV/Weles.hs index 038a194..3633c70 100644 --- a/Festral/SLAV/Weles.hs +++ b/Festral/SLAV/Weles.hs @@ -71,7 +71,7 @@ welesAddr x = (netIP x, netPort x, netFilePort x) curlJobs :: NetAddress -> IO [Job] curlJobs addr = do apiVersion <- getAPIVersion addr - case version <$> apiVersion of + case server <$> apiVersion of (Just "0.2.0") -> V2.curlJobs addr (Just "0.1.0") -> V1.curlJobs addr _ -> Old.curlJobs addr @@ -165,7 +165,7 @@ startJob addr yamlFileName = do getFileList :: NetAddress -> Int -> IO (Maybe [String]) getFileList addr id = do apiVersion <- getAPIVersion addr - (apiDependFileList $ version <$> apiVersion) addr id + (apiDependFileList $ server <$> apiVersion) addr id where apiDependFileList (Just "0.2.0") = V2.getFileList apiDependFileList (Just "0.1.0") = V1.getFileList @@ -185,7 +185,7 @@ genericJobOutFile fileUrl = do getJobOutFile :: NetAddress -> Int -> String -> IO (Maybe String) getJobOutFile addr id fname = do apiVersion <- getAPIVersion addr - (apiJobOutFile $ version <$> apiVersion) addr id fname + (apiJobOutFile $ server <$> apiVersion) addr id fname where apiJobOutFile (Just "0.2.0") = V2.getJobOutFile apiJobOutFile (Just "0.1.0") = V1.getJobOutFile