summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2008-09-08 12:40:09 +0200
committerMartin Sivak <msivak@redhat.com>2008-09-08 12:51:38 +0200
commitee3736fe22286948e4823f3f1fc866f477f882dd (patch)
tree913ca08016b19a73c00442ff0ad123b3e7cc855b
parentea990d0225a87c90d71edbbb08d68e439bcfddc6 (diff)
downloadfirstaidkit-ee3736fe22286948e4823f3f1fc866f477f882dd.tar.gz
firstaidkit-ee3736fe22286948e4823f3f1fc866f477f882dd.tar.xz
firstaidkit-ee3736fe22286948e4823f3f1fc866f477f882dd.zip
Enable prer flow arguments
-rwxr-xr-xfirstaidkit2
-rw-r--r--pyfirstaidkit/plugins.py13
2 files changed, 9 insertions, 6 deletions
diff --git a/firstaidkit b/firstaidkit
index e25c1f7..874484e 100755
--- a/firstaidkit
+++ b/firstaidkit
@@ -143,7 +143,7 @@ def usage(name):
--list - list all plugins
--info <plugin> - get information about plugin
--nodeps - do not use plugin dependencies
- --plugin-args=<plugin_name args>
+ --plugin-args=<plugin_name[/flow] args>
- optionally pass arguments to plugin_name
""" % (name, name, name, name, name))
diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py
index 3dda77c..65ef049 100644
--- a/pyfirstaidkit/plugins.py
+++ b/pyfirstaidkit/plugins.py
@@ -602,20 +602,23 @@ class PluginSystem(object):
message = plugin)
return False
- args = None
+ args = []
if Config.has_section("plugin-args"):
for (name, value) in Config.items("plugin-args"):
# We see if the args line begins with any plugin name.
- m = re.search("^%s"%plugin, value)
+ m = re.search("^%s "%plugin, value)
if m:
- args = value.strip(plugin).strip(" ")
- break
+ args.append(value.strip(plugin).strip(" "))
+ # We also want to be able to configure separate flows
+ m = re.search("^%s/%s "% (plugin, flowName), value)
+ if m:
+ args.append(value.strip(plugin).strip(" "))
infosection = getattr(Info, plugin)
infosection.unlock()
p = pklass(flowName, reporting = self._reporting,
dependencies = self._deps, backups = self._backups,
- path = plugindir, info = infosection, args = args)
+ path = plugindir, info = infosection, args = " ".join(args))
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." %