summaryrefslogtreecommitdiffstats
path: root/pyfirstaidkit/plugins.py
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2008-06-30 14:08:05 +0200
committerMartin Sivak <msivak@redhat.com>2008-06-30 14:08:05 +0200
commitfaf2cc5a133e915bd69b679a66907e14955cefa8 (patch)
treebd73143e82b1bd4b2ea3af383311772668151c21 /pyfirstaidkit/plugins.py
parent98e5fd8c027efb61070f3b255dc15a32d0dc758e (diff)
downloadfirstaidkit-faf2cc5a133e915bd69b679a66907e14955cefa8.tar.gz
firstaidkit-faf2cc5a133e915bd69b679a66907e14955cefa8.tar.xz
firstaidkit-faf2cc5a133e915bd69b679a66907e14955cefa8.zip
Add the Info object and make it possible to override lock for single section
Diffstat (limited to 'pyfirstaidkit/plugins.py')
-rw-r--r--pyfirstaidkit/plugins.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py
index ecf1444..28b2221 100644
--- a/pyfirstaidkit/plugins.py
+++ b/pyfirstaidkit/plugins.py
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-from configuration import Config
+from configuration import Config, Info
from returns import *
from errors import *
from reporting import *
@@ -100,7 +100,7 @@ class Plugin(object):
default_flow = "diagnose"
- def __init__(self, flow, reporting, dependencies, path = None, backups = None):
+ def __init__(self, flow, reporting, dependencies, path = None, backups = None, info = None):
""" Initialize the instance.
flow -- Name of the flow to be used with this instance.
@@ -114,6 +114,7 @@ class Plugin(object):
self._dependencies = dependencies
self._path = path
self._backups = backups
+ self._info = info
self.provide = dependencies.provide
self.unprovide = dependencies.unprovide
@@ -542,7 +543,9 @@ class PluginSystem(object):
self._reporting.stop(level = PLUGIN, origin = self, message = plugin)
return False
- p = pklass(flowName, reporting = self._reporting, dependencies = self._deps, backups = self._backups, path = plugindir)
+ infosection = getattr(Info, plugin)
+ infosection.unlock()
+ p = pklass(flowName, reporting = self._reporting, dependencies = self._deps, backups = self._backups, path = plugindir, info = infosection)
for (step, rv) in p: #autorun all the needed steps
Logger.info("Running step %s in plugin %s ...", step, plugin)
Logger.info("%s is current step and %s is result of that step." % (step, rv))