Check for `when=False` *and* `when=0` due to `AttrBoolData` actually being an int.
This is because Python won't allow sublcassing from bool!
@@ -263,8 +263,10 @@ def operation(func=None, pipeline_facts=None):
(state.limit_hosts is not None and host not in state.limit_hosts)
# Limited by the operation kwarg hosts?
or (hosts is not None and host not in hosts)
- # Limited by the operation kwarg when?
- or when is False
+ # Limited by the operation kwarg when? We check 0 because when is
+ # normally attribute wrapped as a AttrDataBool, which is actually
+ # an integer (Python doesn't allow subclassing bool!).
+ or when is False or when is 0
):
return OperationMeta(op_hash)
