summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Generators
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-01-27 17:34:40 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-01-27 17:34:40 +0000
commitb9ac6e48c38beb674c18eae33c5b8a6f2eb39f33 (patch)
tree0d063d8cfce0c78465e4e31787fa8f19d0c1c3e7 /src/lib/Server/Generators
parentc8c46308bcf181fc17e0e9db2017fdd76dc894c7 (diff)
downloadbcfg2-b9ac6e48c38beb674c18eae33c5b8a6f2eb39f33.tar.gz
bcfg2-b9ac6e48c38beb674c18eae33c5b8a6f2eb39f33.tar.bz2
bcfg2-b9ac6e48c38beb674c18eae33c5b8a6f2eb39f33.zip
kill old debug message
2005/01/20 17:13:51-06:00 anl.gov!desai tighten up fam event propagation (Logical change 1.194) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@826 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Generators')
-rw-r--r--src/lib/Server/Generators/Cfg.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/Server/Generators/Cfg.py b/src/lib/Server/Generators/Cfg.py
index f8d247e61..8f5aaff51 100644
--- a/src/lib/Server/Generators/Cfg.py
+++ b/src/lib/Server/Generators/Cfg.py
@@ -37,7 +37,7 @@ class FileEntry(FileBacked):
class ConfigFileEntry(object):
'''ConfigFileEntry is a repository entry for a single file, containing
all data for all clients.'''
- specific = regcompile('(.*/)(?P<filename>[\w\-.]+)\.((H_(?P<hostname>\S+))|' +
+ specific = regcompile('(.*/)(?P<filename>[\S\-.]+)\.((H_(?P<hostname>\S+))|' +
'(B(?P<bprio>\d+)_(?P<bundle>\S+))|(A(?P<aprio>\d+)_(?P<attr>\S+))|' +
'(I(?P<iprio>\d+)_(?P<image>\S+))|(C(?P<cprio>\d+)_(?P<class>\S+)))' +
'(\.(?P<op>cat|udiff))?$')
@@ -45,9 +45,10 @@ class ConfigFileEntry(object):
'perms:(\s)*(?P<perms>\w+)|encoding:(\s)*(?P<encoding>\w+)|' +
'(?P<paranoid>paranoid(\s)*)$')
- def __init__(self, path):
+ def __init__(self, path, repopath):
object.__init__(self)
self.path = path
+ self.repopath = repopath
self.basefiles = []
self.deltas = []
self.metadata = {'encoding': 'ascii', 'owner':'root', 'group':'root', 'perms':'0644'}
@@ -55,7 +56,7 @@ class ConfigFileEntry(object):
def read_info(self):
'''read in :info metadata'''
- filename = "%s/:info" % self.path
+ filename = "%s/:info" % self.repopath
for line in open(filename).readlines():
match = self.info.match(line)
if not match:
@@ -109,6 +110,10 @@ class ConfigFileEntry(object):
action = event.code2str()
if event.filename == ':info':
return self.read_info()
+ if event.filename != self.path.split('/')[-1]:
+ if not self.specific.match('/' + event.filename):
+ syslog(LOG_INFO, 'Cfg: Suppressing event for bogus file %s' % event.filename)
+ return
for entry in self.basefiles + self.deltas:
if entry.name.split('/')[-1] == event.filename:
if action == 'changed':
@@ -192,8 +197,9 @@ class Cfg(Generator):
else:
# file entries shouldn't contain path-to-repo
shortname = '/'+ '/'.join(name[len(self.data)+1:].split('/')[:-1])
+ repodir = '/' + '/'.join(name.split('/')[:-1])
if not self.entries.has_key(shortname):
- self.entries[shortname] = ConfigFileEntry(shortname)
+ self.entries[shortname] = ConfigFileEntry(shortname, repodir)
self.__provides__['ConfigFile'][shortname] = self.entries[shortname].GetConfigFile
self.entries[shortname].AddEntry(name)
self.entries[shortname].HandleEvent(event)
@@ -202,7 +208,7 @@ class Cfg(Generator):
'''Handle FAM updates'''
action = event.code2str()
if self.tempfile.match(event.filename):
- syslog(LOG_INFO, "Suppressed event for file %s" % event.filename)
+ syslog(LOG_INFO, "Cfg: Suppressed event for file %s" % event.filename)
return
if event.filename[0] != '/':
filename = "%s/%s" % (self.famID[event.requestID], event.filename)