Skip to content
Snippets Groups Projects
Commit e79f576c authored by Dato Simó's avatar Dato Simó
Browse files

Loader.hs: rewrite extractExTags to use chompPrefix


Signed-off-by: default avatarDato Simó <dato@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b009f682
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ module Ganeti.HTools.Loader
import Data.List
import qualified Data.Map as M
import Data.Maybe
import Text.Printf (printf)
import qualified Ganeti.HTools.Container as Container
......@@ -185,9 +186,7 @@ longestDomain (x:xs) =
-- | Extracts the exclusion tags from the cluster configuration.
extractExTags :: [String] -> [String]
extractExTags =
map (drop (length exTagsPrefix)) .
filter (isPrefixOf exTagsPrefix)
extractExTags = filter (not . null) . mapMaybe (chompPrefix exTagsPrefix)
-- | Extracts the common suffix from node\/instance names.
commonSuffix :: Node.List -> Instance.List -> String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment