diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-20 21:33:31 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-20 21:33:31 -0400 |
| commit | 9fea2fb5b7c146428cb2f586a3e2b6c4e68264a5 (patch) | |
| tree | ccd9f7d794baa2f2bc3bfcb1727595e03be133ed /src | |
| parent | d3c2ca307475a59396b545f2d5cbcee08f016083 (diff) | |
| parent | c1e0a968668c6469524337ac73c19ea0f495a62c (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/ControlHeir.hs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Propellor/Property/ControlHeir.hs b/src/Propellor/Property/ControlHeir.hs index 6cf376be..531f884a 100644 --- a/src/Propellor/Property/ControlHeir.hs +++ b/src/Propellor/Property/ControlHeir.hs @@ -12,8 +12,6 @@ import Propellor.Spin (spin, SpinMode(..)) import Propellor.Types.Info import qualified Propellor.Property.Ssh as Ssh -import qualified Data.Set as S - -- | A hierarchy of control. When propellor is run on a host that -- is a Controller, it in turn spins each of the hosts in its control -- list. @@ -63,18 +61,18 @@ instance DirectlyControlled ControlList where -- sub-hierarchies. deloop :: Host -> ControlHeir -> ControlHeir deloop _ (Controlled h) = Controlled h -deloop host (Controller h cl) = Controller h (removeh cl) +deloop thehost (Controller h cl) = Controller h (removeh cl) where removeh (ControlList l) = ControlList (mapMaybe removeh' l) - removeh (ControlReq ch cl) = case removeh' ch of - Just ch' -> ControlReq ch' (removeh cl) - Nothing -> removeh cl + removeh (ControlReq ch cl') = case removeh' ch of + Just ch' -> ControlReq ch' (removeh cl') + Nothing -> removeh cl' removeh' (Controlled h') - | hostName h' == hostName host = Nothing + | hostName h' == hostName thehost = Nothing | otherwise = Just (Controlled h') - removeh' (Controller h' cl) - | hostName h' == hostName host = Nothing - | otherwise = Just (Controller h' (removeh cl)) + removeh' (Controller h' cl') + | hostName h' == hostName thehost = Nothing + | otherwise = Just (Controller h' (removeh cl')) -- | Applies a ControlHeir to a list of hosts. -- |
