error out under the right conditions
@@ -154,6 +154,7 @@ def operation(func=None, pipeline_facts=None):
state = kwargs['state'] = pseudo_state._module
host = kwargs['host'] = pseudo_host._module
+ if not state or not host:
if state.in_op:
raise PyinfraError((
'Nested operation called without state/host: {0} ({1})'
