Re: Please make it easier to detect fai-diskimage
I definitely want install not dirinstall in the case where I'm
installing onto seconds disks on the running system.
I do want GRUB_EFI or GRUB_PC (and they look like they'll work fine in
I also want partition, mountdisks, etc.
A new action makes sense for diskimage if that works well with the rest
of the system.
I think the big question in my mind is whether it makes other tests
throughout the rest of the code too complex.
I think you need a new action, a new variable, or a subroutine like
ifclass. If you want to minimize variables, introducing a short
subroutine seems like a reasonable way to encapsulate the test if a new
action ends up being bad for other reasons.
I think that testing both FAI_ACTION = install and
DO_INIT_TASKS = 1 has two problems.
First, reading the test, it's not obvious that you're testing for
So, you tend to need a comment as you did.
That's a good sign that a better abstraction is needed.
Second it seems like a set of conditions that might not be stable enough
to replicate through a bunch of code. As I explained above, I actually
think you can get non-diskimage cases where action is install and
DO_INITTASKS is 0. Even if I'm wrong and that doesn't work with current
fai, it seems like something that might happen in the future.
It's important to have stable tests for things like this because users
will copy this into configspaces. You can't refactor their code for
I'll also admit that the kind of multi-variable test that doesn't seem
to directly test what you're looking for reminds me a lot of the hardest
to debug parts of live-build, so I'm perhaps overly sensitive to that