Hello! This is my initial stab at the implementation of the harep tool. Comments about the implementation welcome, including (but not necessarily limited to) style or language features. ;-)
Re: testing: I think that the way to go to test this is to add a test on QA, at least that's what I had in mind. Please let me know if you think differently. Initially I wanted for the tool to be able to load data from a file (-t) too, and proceed from there, to help with testing (the repair jobs would e.g. be printed instead of executed). I have some work-in-progress on that front, but it's a bit of a mess because of things like "querying for completed jobs". So I'd rather keep the hard requirement for a Luxi socket, and test with a QA test (which I'd provide). Thanks in advance for the review, Dato Simó (11): Jobs.hs: add an execJobs function Jobs.hs: add an execJobsWaitOk function Jobs.hs: start with a shorter delay in waitForJobs HTools/Types.hs: minor adjustments to auto-repair types Program/Harep.hs: add skeleton for the new auto-repair tool harep: initial parsing of tags harep: check for completed jobs at the start of the program harep: pure function to detect brokeness with instances harep: create repair jobs harep: do not wait for repair job completion to set tags harep: finish execution with a summary of instance states Makefile.am | 3 +- src/Ganeti/HTools/Program/Harep.hs | 464 +++++++++++++++++++++++++++++++++++++ src/Ganeti/HTools/Program/Main.hs | 4 + src/Ganeti/HTools/Types.hs | 11 +- src/Ganeti/Jobs.hs | 56 +++-- 5 files changed, 520 insertions(+), 18 deletions(-) create mode 100644 src/Ganeti/HTools/Program/Harep.hs -- 1.8.0.2-x20-1
