diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-04-08 17:10:27 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-04-08 17:10:27 +0000 |
commit | b44aeec328eacb72e54ab4dcc18bf4490ece8108 (patch) | |
tree | 1f2e27a435d892053a21d8fb97c520b385faa98f /src/lib/Server/Plugin.py | |
parent | 4375f9d65ffb52c455e9601d2de88b17d7f3eb26 (diff) | |
download | bcfg2-b44aeec328eacb72e54ab4dcc18bf4490ece8108.tar.gz bcfg2-b44aeec328eacb72e54ab4dcc18bf4490ece8108.tar.bz2 bcfg2-b44aeec328eacb72e54ab4dcc18bf4490ece8108.zip |
Move base data caching es class to Plugin.py
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4488 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r-- | src/lib/Server/Plugin.py | 13 |
1 files changed, 13 insertions, 0 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]))$") |