Rework exit model
authorIustin Pop <iustin@google.com>
Thu, 22 Mar 2012 12:34:53 +0000 (12:34 +0000)
committerIustin Pop <iustin@google.com>
Thu, 22 Mar 2012 17:30:13 +0000 (17:30 +0000)
commit88a10df5a1f40e77d5321aec02109bd0ad01e578
tree902ddb2d63e9e40a7cf21dcf8928486c4ea931d8
parent3e5012c6886e8f61b62e77e6fe50b1cc37e4c8d2
Rework exit model

While updating the confd code, I realised that we have _lots_ of
duplication in the exit model for the various programs.

So this patch attempts to abstract all the exits via a couple of new
functions; sorry for the somewhat big patch, but I hope the payoff is
worth the change: the actual exit conditions are much clearer.

Note that the patch (also) moves the exitIfBad function to Utils.hs,
since that is more logical.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
htools/Ganeti/BasicTypes.hs
htools/Ganeti/Confd/Server.hs
htools/Ganeti/Daemon.hs
htools/Ganeti/HTools/CLI.hs
htools/Ganeti/HTools/ExtLoader.hs
htools/Ganeti/HTools/Program/Hspace.hs
htools/Ganeti/HTools/Utils.hs