On Mon, Jan 21, 2013 at 11:26 +0100, Iustin Pop <[email protected]> wrote:
> > - So then I tried to just hard-code the values: how do you suggest I
> > handle the NonNegative case? Would it be okay to just export
> > forceNonNegative from OpParams.hs?
> Hmmm, that I was hoping to avoid. Please do so for now, but add a FIXME
> both in your code and near the export, as this shouldn't be done.
I wasn't looking properly at mkNonNegative before. Given that
forceNonNegative just errors out if the conversion fails, I think I'll
dispense with exporting it, and just use:
[OpInstanceFailover { ...
, opShutdownTimeout = fromJust $ mkNonNegative
C.defaultShutdownTimeout
...
which has the same effect, if that's ok.
And for optional fields:
[OpInstanceReplaceDisks { ...
, opIallocator = mkNonEmpty "hail"
(Though perhaps `Just . fromJust $ mkNonEmpty "hail"` would be better, if we
want to insist in visible failures.)
Thanks,
--
Dato Simó | [email protected]
Corp Fleet Management / Ganeti SRE (Dublin)