summaryrefslogtreecommitdiffstats
path: root/pyfirstaidkit/plugins.py
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-08-08 17:23:51 +0200
committerJoel Andres Granados <jgranado@redhat.com>2008-08-08 17:58:51 +0200
commitd2ac990fae74934887cba6a01ed5bb6d6c576422 (patch)
tree6f116352651fee9916fdf84f2792fe1e6ab7923d /pyfirstaidkit/plugins.py
parent90054c1550faaef35623979d23421b295262ffbf (diff)
downloadfirstaidkit-d2ac990fae74934887cba6a01ed5bb6d6c576422.tar.gz
firstaidkit-d2ac990fae74934887cba6a01ed5bb6d6c576422.tar.xz
firstaidkit-d2ac990fae74934887cba6a01ed5bb6d6c576422.zip
Make the argument passing more general.
It is possible for the plugin name to have a space. when this occured it threw off the argument detecting logic. This new way of detecting the plugin name is more general.
Diffstat (limited to 'pyfirstaidkit/plugins.py')
-rw-r--r--pyfirstaidkit/plugins.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py
index e373322..3dda77c 100644
--- a/pyfirstaidkit/plugins.py
+++ b/pyfirstaidkit/plugins.py
@@ -27,6 +27,7 @@ import logging
import imp
import os
+import re
import subprocess
from cStringIO import StringIO
@@ -602,8 +603,13 @@ class PluginSystem(object):
return False
args = None
- if Config.has_option("plugin-args", pklass.name):
- args = Config.get("plugin-args", pklass.name)
+ 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)
+ if m:
+ args = value.strip(plugin).strip(" ")
+ break
infosection = getattr(Info, plugin)
infosection.unlock()