From 0f7edd60e67d32438a8be42002faacde4e4a7649 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 9 Aug 2013 16:45:45 -0400 Subject: testsuite: fixed most pylint complaints --- src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Cfg') diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py index a7fa92201..99afac7eb 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py @@ -763,6 +763,7 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet): class CfgHandlerAction(Bcfg2.Options.ComponentAction): + """ Option parser action to load Cfg handlers """ bases = ['Bcfg2.Server.Plugins.Cfg'] @@ -796,10 +797,18 @@ class Cfg(Bcfg2.Server.Plugin.GroupSpool, global CFG # pylint: disable=W0603 Bcfg2.Server.Plugin.GroupSpool.__init__(self, core, datastore) Bcfg2.Server.Plugin.PullTarget.__init__(self) - + self._handlers = None CFG = self __init__.__doc__ = Bcfg2.Server.Plugin.GroupSpool.__init__.__doc__ + @property + def handlers(self): + """ A list of Cfg handler classes. """ + if self._handlers is None: + self._handlers = Bcfg2.Options.setup.cfg_handlers + self._handlers.sort(key=operator.attrgetter("__priority__")) + return self._handlers + def has_generator(self, entry, metadata): """ Return True if the given entry can be generated for the given metadata; False otherwise -- cgit v1.2.3-1-g7c22