summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins
diff options
context:
space:
mode:
authorMike McCallister <mike@mccllstr.com>2011-07-22 23:17:14 -0500
committerMike McCallister <mike@mccllstr.com>2011-07-22 23:17:14 -0500
commit42199a9835a548a0a78f48fd6c5f11c3153371dd (patch)
tree8b67781f8673242edb99268566de868c49040b86 /src/lib/Server/Plugins
parente496fb95eaf9200f78248106f9fd7ec6b7d9e530 (diff)
downloadbcfg2-42199a9835a548a0a78f48fd6c5f11c3153371dd.tar.gz
bcfg2-42199a9835a548a0a78f48fd6c5f11c3153371dd.tar.bz2
bcfg2-42199a9835a548a0a78f48fd6c5f11c3153371dd.zip
Created a new method to return a sorted list of plugins by type.
Replaced many list comprehensions in Core.py with a new method named plugins_by_type(), which does the same thing with an added twist: this new method also sorts the list of plugins by a new field named sort_order. It also uses the name of the plugin where the sort_order values are the same. This lets us control the processing sequence of plugins that need to build on the results of a plugin that runs prior to them. The immediate example is Deps, which should run after Packages has generated the full list of packages to be installed. Prior to this commit, it was impossible to control the order in which they ran. A future commit will (hopefully) take advantage of this capability. This commit also splits the Core.validate_data() method into two: one for validate_structures() and one for validate_goals(), instead of passing in a base class and using if logic. This approach seemed a little clearer to me.
Diffstat (limited to 'src/lib/Server/Plugins')
-rw-r--r--src/lib/Server/Plugins/Metadata.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index 7fc34f178..bfe1ac053 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -222,6 +222,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
__version__ = '$Id$'
__author__ = 'bcfg-dev@mcs.anl.gov'
name = "Metadata"
+ sort_order = 500
def __init__(self, core, datastore, watch_clients=True):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)