Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
import Data.List
import qualified Data.Map as M
+import Data.Maybe
import Text.Printf (printf)
import qualified Ganeti.HTools.Container as Container
-- | 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