From 4e038a43cc9978af1015c53ab7cf27355d989069 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Oct 2015 13:57:51 -0400 Subject: use Info to detect controller loops Much less invasive than the other implementation. --- src/Propellor/Spin.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Propellor/Spin.hs') diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs index 401c9375..ecefbf6e 100644 --- a/src/Propellor/Spin.hs +++ b/src/Propellor/Spin.hs @@ -40,8 +40,8 @@ commitSpin = do void $ actionMessage "Push to central git repository" $ boolSystem "git" [Param "push"] -spin :: HostName -> Maybe HostName -> ControllerChain -> Host -> IO () -spin target relay cc hst = do +spin :: HostName -> Maybe HostName -> Host -> IO () +spin target relay hst = do cacheparams <- if viarelay then pure ["-A"] else toCommand <$> sshCachingParams hn @@ -89,9 +89,7 @@ spin target relay cc hst = do runcmd = "cd " ++ localdir ++ " && ./propellor " ++ cmd cmd = if viarelay then "--serialized " ++ shellEscape (show (Spin [target] (Just target))) - else if cc == mempty - then "--continue " ++ shellEscape (show (SimpleRun target)) - else "--continue " ++ shellEscape (show (ControlledRun target cc)) + else "--continue " ++ shellEscape (show (SimpleRun target)) -- Check if the Host contains an IP address that matches one of the IPs -- in the DNS for the HostName. If so, the HostName is used as-is, -- cgit v1.3-2-g0d8e