Skip to content

Commit

Permalink
Fix resolving Weles API version by server version
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau Harbuz <[email protected]>
Change-Id: I711aee019ff2e4e196c75da51577130ccbd4c036
  • Loading branch information
Shadasviar committed Mar 15, 2019
1 parent 1f81bb2 commit 897b68a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Festral.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions Festral/SLAV/Weles.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 897b68a

Please sign in to comment.