This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
Hosts: More options for in-host callbacks #3357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief description
Modules are acknowledged on host installation that host was installed so they can register their specific callbacks. Workfiles tool also trigger events on workfile open. Moved start timer callback on task change to timers manager.
Description
Modules have method
on_host_install
which is called wheninstall_host
is called, these modules are kept in memory (they're not refreshed for rest of process) that is because modules would be garbage collected and their callbacks would not work. Workfiles tool is triggeringworkfile.open.before
andworkfile.open.after
. All events triggered from workfiles tool also contain context information (host name, project name, asset name and task name) so it's not just blind information. Task changed topic has human readable keys. Logic related to start timer on task change was moved to timers manager module.Additional information
Reason of this feature is to be able register event callbacks which are module specific and to be able catch workfiles opening when workfiles tool is used.
Testing notes:
Change related to timers manager:
New feature adding ability to catch host installation:
on_host_install
where you can do some logic which you want.