summaryrefslogtreecommitdiffstats
path: root/tasker
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2007-11-29 11:07:33 +0100
committerMartin Sivak <msivak@redhat.com>2007-11-29 11:07:33 +0100
commita62614a26e4bb0e99421dc4e9a66ff53121ffaac (patch)
treef280fea7d79a35cd3269f6d80f861520f33379cd /tasker
parentd5323c105843804c3d55f572a3a8b9474424da9d (diff)
downloadfirstaidkit-a62614a26e4bb0e99421dc4e9a66ff53121ffaac.tar.gz
firstaidkit-a62614a26e4bb0e99421dc4e9a66ff53121ffaac.tar.xz
firstaidkit-a62614a26e4bb0e99421dc4e9a66ff53121ffaac.zip
Make it possible to select flow from plugin
Diffstat (limited to 'tasker')
-rw-r--r--tasker/plugins.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tasker/plugins.py b/tasker/plugins.py
index dee5602..1a11a97 100644
--- a/tasker/plugins.py
+++ b/tasker/plugins.py
@@ -276,15 +276,23 @@ class PluginSystem(object):
"""Return the list of imported plugins"""
return self._plugins.keys()
- def autorun(self, plugin):
+ def autorun(self, plugin, flow = None):
"""Perform automated run of plugin"""
pklass = self._plugins[plugin].get_plugin() #get top level class of plugin
Logger.info("Plugin information...")
Logger.info("name:%s , version:%s , author:%s " % pklass.info())
flows = pklass.getFlows()
Logger.info("Provided flows : %s " % flows)
- flowName = pklass.default_flow
+ if flow==None:
+ flowName = pklass.default_flow
+ else:
+ flowName = flow
+
Logger.info("Using %s flow" % flowName)
+ if flowName not in flows:
+ Logger.error("Flow %s does not exist in plugin %s", flowName, plugin)
+ return
+
p = pklass(flowName)
for (step, rv) in p: #autorun all the needed steps
Logger.info("Running step %s in plugin %s ...", step, plugin)