summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Cfg
diff options
context:
space:
mode:
authorMichael Fenn <fennm@deshawresearch.com>2013-05-24 12:11:55 -0400
committerMichael Fenn <fennm@deshawresearch.com>2013-05-24 12:11:55 -0400
commit6fffddf1cc3e73bf831fb3bbe36c928d1ebb8c77 (patch)
treedb2978e695c602b46c7de5cd7e45843aa798325e /src/lib/Bcfg2/Server/Plugins/Cfg
parentf1f33a03d25618e680736aaa6bb590ab1f5ac22d (diff)
downloadbcfg2-6fffddf1cc3e73bf831fb3bbe36c928d1ebb8c77.tar.gz
bcfg2-6fffddf1cc3e73bf831fb3bbe36c928d1ebb8c77.tar.bz2
bcfg2-6fffddf1cc3e73bf831fb3bbe36c928d1ebb8c77.zip
Cfg: Handle bogus created events as changed
It is possible for the FAM (gamin in particular) to send a created event for a file that already exists if the file is updated in a particular way. I suppose that the event is technically correct since a new inode really was created, but the file is only changed from bcfg2's point of view. For instance, the "atomic" copy-to-temp-then-move-over-top method that rsync uses will expose this behavior. Example: rsync -a --temp-dir=/var/tmp --delete-after \ --exclude Packages/cache --exclude Packages/keys \ --exclude Reporting/DirectStore --exclude probed.xml \ /var/lib/bcfg2/ $OTHERSERVER:/var/lib/bcfg2
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Cfg')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
index ffe93c25b..c6ac9d8dc 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
@@ -520,7 +520,9 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet,
return
elif hdlr.ignore(event, basename=self.path):
return
- elif action == 'changed':
+ # we only get here if event.filename in self.entries, so handle
+ # created event like changed
+ elif action == 'changed' or action == 'created':
self.entries[event.filename].handle_event(event)
return
elif action == 'deleted':