On 18.02.21 14:34, Thomas Lamprecht wrote:
>>>> + if (!defined($dataset_mounted->())) {
>>> don't complicated boolean, drop the defined.
>> in that case the return value of $dataset_mounted->() is ternary:
> Then the more NAK'd for my taste, that method being ternary is IMO
> not nice and sensible.
>
> Please, make it boolean (in the perverse sense perl defines bool)
>
>> * undefined - error during `zfs get` -> we most likely need to import the
>> pool
And here I do not mean I do not want to have such a heuristic or the like,
but I'd like it a bit more explicit, as having defined but false and undefined
differ is always a bit a recipe for misuse (yeah it's a local closure so it
doesn't need to be held against the standards of a "public" method but still,
not ideal.
Maybe avoid the eval in the closure and handle the error explicit?
_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel