@ -348,22 +348,17 @@ class StrategyBase:
# dependency chain of the current task (if it's from a role), otherwise
# dependency chain of the current task (if it's from a role), otherwise
# we just look through the list of handlers in the current play/all
# we just look through the list of handlers in the current play/all
# roles and use the first one that matches the notify name
# roles and use the first one that matches the notify name
target_handler = None
target_handler = search_handler_blocks ( iterator . _play . handlers )
if original_task . _role :
target_handler = search_handler_blocks ( original_task . _role . get_handler_blocks ( ) )
if target_handler is None :
target_handler = search_handler_blocks ( iterator . _play . handlers )
if target_handler is None :
if target_handler is None :
raise AnsibleError ( " The requested handler ' %s ' was not found in any of the known handlers " % handler_name )
raise AnsibleError ( " The requested handler ' %s ' was not found in any of the known handlers " % handler_name )
# FIXME: this should be an error now in 2.1+
if target_handler in self . _notified_handlers :
if target_handler not in self . _notified_handlers :
if original_host not in self . _notified_handlers [ target_handler ] :
self . _notified_handlers [ target_handler ] = [ ]
self . _notified_handlers [ target_handler ] . append ( original_host )
# FIXME: should this be a callback?
if original_host not in self . _notified_handlers [ target_handler ] :
display . vv ( " NOTIFIED HANDLER %s " % ( handler_name , ) )
self . _notified_handlers [ target_handler ] . append ( original_host )
else :
# FIXME: should this be a callback?
raise AnsibleError ( " The requested handler ' %s ' was not found in the main handlers list " % handler_name )
display . vv ( " NOTIFIED HANDLER %s " % ( handler_name , ) )
elif result [ 0 ] == ' register_host_var ' :
elif result [ 0 ] == ' register_host_var ' :
# essentially the same as 'set_host_var' below, however we
# essentially the same as 'set_host_var' below, however we