Convert Luxi results to Ganeti errors
This a bit too complex patch converts the result of Luxi calls (submitJob, query*, etc.) from Result to ErrorResult. It then immediately revers this in the HTools/Backend/Luxi module, where we don't need necessarily the full error type (just a nice error message), and does the same in Hbal's job execution functions. While at first sight this doesn't seem to do much, what we get is actual error messages from Ganeti, plus improvements to the result parsing: instead of "can't parse char", we now get properly (note, wrapped manually): Executing jobset for instances instance1, … Job submission error: Failure: the job queue is marked for drain and doesn't accept new requests Or: Job submission error: Unhandled exception: LuxiError "parsing job id: cannot parse string 'a956101'" Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
Showing
- htools/Ganeti/Errors.hs 7 additions, 1 deletionhtools/Ganeti/Errors.hs
- htools/Ganeti/HTools/Backend/Luxi.hs 6 additions, 4 deletionshtools/Ganeti/HTools/Backend/Luxi.hs
- htools/Ganeti/HTools/Program/Hbal.hs 4 additions, 3 deletionshtools/Ganeti/HTools/Program/Hbal.hs
- htools/Ganeti/Luxi.hs 36 additions, 21 deletionshtools/Ganeti/Luxi.hs
Loading
Please register or sign in to comment