Change struct returned by hook_callback

This commit is contained in:
Josué Tille 2018-08-29 20:56:00 +02:00
parent 29bf70c57c
commit e4e981c0fe

View file

@ -230,6 +230,7 @@ def hook_callback(action, hooks=[], args=None, no_trace=False, chdir=None,
(name, priority, path, succeed) as arguments
"""
result = {}
hooks_dict = {}
# Retrieve hooks
@ -290,12 +291,8 @@ def hook_callback(action, hooks=[], args=None, no_trace=False, chdir=None,
else:
post_callback(name=name, priority=priority, path=path,
succeed=True)
try:
result[name][state].append(path)
except KeyError:
result[name][state] = [path]
result[name]['stdreturn'] = hook_return
result[name] = {'path' : path, 'state' : state, 'stdreturn' : hook_return }
return result