Revision c6ccc073
b/htools/Ganeti/HTools/Loader.hs | ||
---|---|---|
156 | 156 |
in inst { Instance.tags = new_tags } |
157 | 157 |
|
158 | 158 |
-- | Update the movable attribute |
159 |
updateMovable :: [String] -> Instance.Instance -> Instance.Instance |
|
160 |
updateMovable exinst inst = |
|
159 |
updateMovable :: [String] -- ^ Selected instances (if not empty) |
|
160 |
-> [String] -- ^ Excluded instances |
|
161 |
-> Instance.Instance -- ^ Target Instance |
|
162 |
-> Instance.Instance -- ^ Target Instance with updated attribute |
|
163 |
updateMovable selinsts exinsts inst = |
|
161 | 164 |
if Instance.sNode inst == Node.noSecondary || |
162 |
Instance.name inst `elem` exinst |
|
165 |
Instance.name inst `elem` exinsts || |
|
166 |
not (null selinsts || Instance.name inst `elem` selinsts) |
|
163 | 167 |
then Instance.setMovable inst False |
164 | 168 |
else inst |
165 | 169 |
|
... | ... | |
205 | 209 |
) il2 um |
206 | 210 |
allextags = extags ++ extractExTags tags |
207 | 211 |
il4 = Container.map (filterExTags allextags . |
208 |
updateMovable exinsts) il3 |
|
212 |
updateMovable selinsts exinsts) il3
|
|
209 | 213 |
nl2 = foldl' fixNodes nl (Container.elems il4) |
210 | 214 |
nl3 = Container.map (flip Node.buildPeers il4) nl2 |
211 | 215 |
node_names = map Node.name (Container.elems nl) |
Also available in: Unified diff