Revision b6d9bec8
b/Makefile.am | ||
---|---|---|
436 | 436 |
# All Haskell non-test programs to be compiled but not automatically installed |
437 | 437 |
HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS) |
438 | 438 |
|
439 |
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck hroller |
|
439 |
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
|
|
440 | 440 |
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail |
441 | 441 |
|
442 | 442 |
HS_ALL_PROGS = \ |
... | ... | |
505 | 505 |
src/Ganeti/HTools/Node.hs \ |
506 | 506 |
src/Ganeti/HTools/PeerMap.hs \ |
507 | 507 |
src/Ganeti/HTools/Program/Hail.hs \ |
508 |
src/Ganeti/HTools/Program/Harep.hs \ |
|
508 | 509 |
src/Ganeti/HTools/Program/Hbal.hs \ |
509 | 510 |
src/Ganeti/HTools/Program/Hcheck.hs \ |
510 | 511 |
src/Ganeti/HTools/Program/Hinfo.hs \ |
b/src/Ganeti/HTools/Program/Harep.hs | ||
---|---|---|
1 |
{-| Auto-repair tool for Ganeti. |
|
2 |
|
|
3 |
-} |
|
4 |
|
|
5 |
{- |
|
6 |
|
|
7 |
Copyright (C) 2013 Google Inc. |
|
8 |
|
|
9 |
This program is free software; you can redistribute it and/or modify |
|
10 |
it under the terms of the GNU General Public License as published by |
|
11 |
the Free Software Foundation; either version 2 of the License, or |
|
12 |
(at your option) any later version. |
|
13 |
|
|
14 |
This program is distributed in the hope that it will be useful, but |
|
15 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
General Public License for more details. |
|
18 |
|
|
19 |
You should have received a copy of the GNU General Public License |
|
20 |
along with this program; if not, write to the Free Software |
|
21 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
22 |
02110-1301, USA. |
|
23 |
|
|
24 |
-} |
|
25 |
|
|
26 |
module Ganeti.HTools.Program.Harep |
|
27 |
( main |
|
28 |
, arguments |
|
29 |
, options) where |
|
30 |
|
|
31 |
import Control.Monad |
|
32 |
|
|
33 |
import Ganeti.Common |
|
34 |
import Ganeti.Utils |
|
35 |
|
|
36 |
import Ganeti.HTools.CLI |
|
37 |
|
|
38 |
-- | Options list and functions. |
|
39 |
options :: IO [OptType] |
|
40 |
options = do |
|
41 |
luxi <- oLuxiSocket |
|
42 |
return |
|
43 |
[ luxi |
|
44 |
] |
|
45 |
|
|
46 |
arguments :: [ArgCompletion] |
|
47 |
arguments = [] |
|
48 |
|
|
49 |
-- | Main function. |
|
50 |
main :: Options -> [String] -> IO () |
|
51 |
main _unused_opts args = do |
|
52 |
unless (null args) $ |
|
53 |
exitErr "this program doesn't take any arguments." |
|
54 |
|
|
55 |
return () |
b/src/Ganeti/HTools/Program/Main.hs | ||
---|---|---|
38 | 38 |
import Ganeti.Common (formatCommands, PersonalityList) |
39 | 39 |
import Ganeti.HTools.CLI (Options, parseOpts, genericOpts) |
40 | 40 |
import qualified Ganeti.HTools.Program.Hail as Hail |
41 |
import qualified Ganeti.HTools.Program.Harep as Harep |
|
41 | 42 |
import qualified Ganeti.HTools.Program.Hbal as Hbal |
42 | 43 |
import qualified Ganeti.HTools.Program.Hcheck as Hcheck |
43 | 44 |
import qualified Ganeti.HTools.Program.Hscan as Hscan |
... | ... | |
53 | 54 |
"Ganeti IAllocator plugin that implements the instance\ |
54 | 55 |
\ placement and movement using the same algorithm as\ |
55 | 56 |
\ hbal(1)")) |
57 |
, ("harep", (Harep.main, Harep.options, Harep.arguments, |
|
58 |
"auto-repair tool that detects certain kind of problems\ |
|
59 |
\ with instances and applies the allowed set of solutions")) |
|
56 | 60 |
, ("hbal", (Hbal.main, Hbal.options, Hbal.arguments, |
57 | 61 |
"cluster balancer that looks at the current state of\ |
58 | 62 |
\ the cluster and computes a series of steps designed\ |
b/test/hs/Test/Ganeti/Common.hs | ||
---|---|---|
135 | 135 |
[ " hail - Ganeti IAllocator plugin that implements the instance\ |
136 | 136 |
\ placement and" |
137 | 137 |
, " movement using the same algorithm as hbal(1)" |
138 |
, " harep - auto-repair tool that detects certain kind of problems\ |
|
139 |
\ with instances" |
|
140 |
, " and applies the allowed set of solutions" |
|
138 | 141 |
, " hbal - cluster balancer that looks at the current state of\ |
139 | 142 |
\ the cluster and" |
140 | 143 |
, " computes a series of steps designed to bring the\ |
Also available in: Unified diff