summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-17 15:07:45 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-17 15:07:45 -0400
commitb7e2699f5156607258ed0d500c5d6d6b92c35f26 (patch)
tree24bde5be78c5d9920d21b3f79de06474ff3d282f /src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
parent044213c789c4f1ee214da3d70f02352b1aaa8673 (diff)
parent7e93fe741c17203fa63f60a7d1f66bfcdfb90d03 (diff)
downloadbcfg2-b7e2699f5156607258ed0d500c5d6d6b92c35f26.tar.gz
bcfg2-b7e2699f5156607258ed0d500c5d6d6b92c35f26.tar.bz2
bcfg2-b7e2699f5156607258ed0d500c5d6d6b92c35f26.zip
Merge branch 'maint'
Conflicts: doc/appendix/guides/centos.txt doc/server/plugins/grouping/metadata.txt setup.py src/lib/Bcfg2/Client/Frame.py src/lib/Bcfg2/Client/Proxy.py src/lib/Bcfg2/Server/Lint/Genshi.py src/lib/Bcfg2/Server/Lint/Validate.py src/lib/Bcfg2/Server/Plugins/Bundler.py src/lib/Bcfg2/Server/Plugins/SSHbase.py src/sbin/bcfg2-lint
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/TemplateHelper.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/TemplateHelper.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py b/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
index e834759c2..050ba3b3e 100644
--- a/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
+++ b/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
@@ -96,7 +96,18 @@ class TemplateHelper(Bcfg2.Server.Plugin.Plugin,
class TemplateHelperLint(Bcfg2.Server.Lint.ServerPlugin):
- """ find duplicate Pkgmgr entries with the same priority """
+ """ ``bcfg2-lint`` plugin to ensure that all :ref:`TemplateHelper
+ <server-plugins-connectors-templatehelper>` modules are valid.
+ This can check for:
+
+ * A TemplateHelper module that cannot be imported due to syntax or
+ other compile-time errors;
+ * A TemplateHelper module that does not have an ``__export__``
+ attribute, or whose ``__export__`` is not a list;
+ * Bogus symbols listed in ``__export__``, including symbols that
+ don't exist, that are reserved, or that start with underscores.
+ """
+
def __init__(self, *args, **kwargs):
Bcfg2.Server.Lint.ServerPlugin.__init__(self, *args, **kwargs)
self.reserved_keywords = dir(HelperModule("foo.py"))
@@ -107,7 +118,11 @@ class TemplateHelperLint(Bcfg2.Server.Lint.ServerPlugin):
self.check_helper(helper.name)
def check_helper(self, helper):
- """ check a helper module for export errors """
+ """ Check a single helper module.
+
+ :param helper: The filename of the helper module
+ :type helper: string
+ """
module_name = MODULE_RE.search(helper).group(1)
try: