summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugin.py13
-rw-r--r--src/lib/Server/Plugins/Cfg.py15
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index 4a973ba1c..916927bfa 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -432,6 +432,19 @@ class Specificity:
return True
return False
+class SpecificData(object):
+ def __init__(self, name, _, specific):
+ self.name = name
+ self.specific = specific
+
+ def handle_event(self, event):
+ if event.code2str() == 'deleted':
+ return
+ try:
+ self.data = open(self.name).read()
+ except:
+ logger.error("Failed to read file %s" % self.name)
+
class EntrySet:
'''Entry sets deal with the host- and group-specific entries'''
ignore = re.compile("^(.*~|\\..*\\.(tmp|sw[px]))$")
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index 291ee2c9f..9e078e94f 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -34,19 +34,6 @@ def process_delta(data, delta):
raise Bcfg2.Server.Plugin.PluginExecutionError, ('delta', delta)
return output
-class CfgEntry(object):
- def __init__(self, name, _, specific):
- self.name = name
- self.specific = specific
-
- def handle_event(self, event):
- if event.code2str() == 'deleted':
- return
- try:
- self.data = open(self.name).read()
- except:
- logger.error("Failed to read file %s" % self.name)
-
class CfgMatcher:
def __init__(self, fname):
name = re.escape(fname)
@@ -138,7 +125,7 @@ class Cfg(Bcfg2.Server.Plugin.GroupSpool):
__author__ = 'bcfg-dev@mcs.anl.gov'
use_props = False
es_cls = CfgEntrySet
- es_child_cls = CfgEntry
+ es_child_cls = Bcfg2.Server.Plugin.SpecificData
def AcceptChoices(self, entry, metadata):
return self.entries[entry.get('name')].list_accept_choices(metadata)