summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-14 14:44:08 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-14 15:43:32 -0400
commitbe4f6ad065fa17ae34c810f2c09bc9f5fa4d9c23 (patch)
tree0e4a2172ef4fa94320ddf35756f92d8089e1a980 /src/lib/Bcfg2/Server/Plugins
parent554022ae751777a6f853f54663dc5e9fab818dce (diff)
downloadbcfg2-be4f6ad065fa17ae34c810f2c09bc9f5fa4d9c23.tar.gz
bcfg2-be4f6ad065fa17ae34c810f2c09bc9f5fa4d9c23.tar.bz2
bcfg2-be4f6ad065fa17ae34c810f2c09bc9f5fa4d9c23.zip
added unit tests for EntrySet
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Decisions.py6
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Probes.py5
-rw-r--r--src/lib/Bcfg2/Server/Plugins/TemplateHelper.py7
3 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Decisions.py b/src/lib/Bcfg2/Server/Plugins/Decisions.py
index b432474f2..78b549c2c 100644
--- a/src/lib/Bcfg2/Server/Plugins/Decisions.py
+++ b/src/lib/Bcfg2/Server/Plugins/Decisions.py
@@ -23,9 +23,9 @@ class DecisionSet(Bcfg2.Server.Plugin.EntrySet):
- `encoding`: XML character encoding
"""
- pattern = '(white|black)list'
- Bcfg2.Server.Plugin.EntrySet.__init__(self, pattern, path, \
- DecisionFile, encoding)
+ Bcfg2.Server.Plugin.EntrySet.__init__(self, '(white|black)list', path,
+ DecisionFile, encoding,
+ is_regex=True)
try:
fam.AddMonitor(path, self)
except OSError:
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py
index 53deefebd..e08f52a28 100644
--- a/src/lib/Bcfg2/Server/Plugins/Probes.py
+++ b/src/lib/Bcfg2/Server/Plugins/Probes.py
@@ -115,11 +115,10 @@ class ProbeSet(Bcfg2.Server.Plugin.EntrySet):
bangline = re.compile('^#!\s*(?P<interpreter>.*)$')
def __init__(self, path, fam, encoding, plugin_name):
- fpattern = '[0-9A-Za-z_\-]+'
self.plugin_name = plugin_name
- Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path,
+ Bcfg2.Server.Plugin.EntrySet.__init__(self, '[0-9A-Za-z_\-]+', path,
Bcfg2.Server.Plugin.SpecificData,
- encoding)
+ encoding, is_regex=True)
fam.AddMonitor(path, self)
def HandleEvent(self, event):
diff --git a/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py b/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
index 3712506d6..2b3aa6bc5 100644
--- a/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
+++ b/src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
@@ -50,12 +50,13 @@ class HelperModule(Bcfg2.Server.Plugin.SpecificData):
class HelperSet(Bcfg2.Server.Plugin.EntrySet):
ignore = re.compile("^(\.#.*|.*~|\\..*\\.(sw[px])|.*\.py[co])$")
+ fpattern = '[0-9A-Za-z_\-]+\.py'
def __init__(self, path, fam, encoding, plugin_name):
- fpattern = '[0-9A-Za-z_\-]+\.py'
self.plugin_name = plugin_name
- Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path,
- HelperModule, encoding)
+ Bcfg2.Server.Plugin.EntrySet.__init__(self, self.fpattern, path,
+ HelperModule, encoding,
+ is_regex=True)
fam.AddMonitor(path, self)
def HandleEvent(self, event):