Bug 1276367 - [RFE] Add priority for each plugin hook
[RFE] Add priority for each plugin hook
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: mock (Show other bugs)
epel7
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Clark Williams
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-29 10:32 EDT by Ray Logel
Modified: 2017-04-25 12:14 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Add priority for each plugin hook Reason: Control order plugins are triggered Result: Allow the user to define order.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Potential way to add priority ordering to plugin hooks (1.10 KB, patch)
2015-10-29 10:32 EDT, Ray Logel
no flags Details | Diff

  None (edit)
Description Ray Logel 2015-10-29 10:32:39 EDT
Created attachment 1087563 [details]
Potential way to add priority ordering to plugin hooks

There isn't any way to control the order that plugins execute.  I created a plugin which was triggered using the 'postinit' hook.  I wanted it to be trigger before the root_cache plugin so that my changes can also be cached.  Unfortunately the plugin just stores an array of hooks with no way to control the order they are run.

Attached is a possible solution it could be further extended so that the priority was configurable via the config file.  But if all the existing hooks had a priority of 0, then a new hook could be added with -1 to make sure it went before them or +1 to make sure it when after.

Note You need to log in before you can comment on or make changes to this bug.