summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Core.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Core.py')
-rw-r--r--src/lib/Server/Core.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 6f11e83e7..00d7d41cb 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -9,6 +9,16 @@ import logging, lxml.etree, os, stat, Bcfg2.Server.Metadata, ConfigParser
logger = logging.getLogger('Bcfg2.Core')
+def ShouldIgnore(event):
+ '''Test if the event should be suppresed'''
+ if event.filename.split('/')[-1] == '.svn':
+ return True
+ if event.filename.endswith('~') or event.filename.endswith('.tmp')
+ or event.filename.endswith('.tmp'):
+ logger.error("Suppressing event for file %s" % (event.filename))
+ return True
+ return False
+
class CoreInitError(Exception):
'''This error is raised when the core cannot be initialized'''
pass
@@ -66,8 +76,7 @@ class FamFam(object):
unique = []
bookkeeping = []
for event in rawevents:
- if event.filename.split('/')[-1] == '.svn':
- # ignore svn directories
+ if ShouldIgnore(event):
continue
if event.code2str() != 'changed':
# process all non-change events
@@ -148,8 +157,7 @@ class GaminFam(object):
unique = []
bookkeeping = []
for event in self.events:
- if event.filename.split('/')[-1] == '.svn':
- # skip svn directories
+ if ShouldIgnore(event):
continue
if event.code2str() != 'changed':
# process all non-change events