Skip to content
Snippets Groups Projects
Commit fc3cac5b authored by kaiyou's avatar kaiyou
Browse files

Add some logging for hooks

parent 3b213898
No related branches found
No related tags found
No related merge requests found
Pipeline #2958 passed
......@@ -111,11 +111,11 @@ class BaseApplication(object):
def apply_hooks(self, profile, transition, step):
""" Apply hooks for a given transition and step
"""
results = [
function(self, profile)
for transition_step, transitions, function in self.hooks
if step == transition_step and transition in transitions
]
results = []
for transition_step, transitions, function in self.hooks:
if step == transition_step and transition in transitions:
print(f"Applying hook {function}")
results.append(function(self, profile))
return False in results and not True in results
@hook(models.Profile.INIT, "purge", "purge-blocked")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment