summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <asulfrian@zedat.fu-berlin.de>2022-01-16 09:16:23 +0100
committerAlexander Sulfrian <asulfrian@zedat.fu-berlin.de>2022-01-16 09:35:31 +0100
commit354ef30b43098d88173e7132da8a2a7d8fa55bde (patch)
treeca6814f6dbfd412009944a8d7f49db78068ba3da
parent7ec0586ccaa23f35996a498b255d2ab52e155a55 (diff)
parent79838c23f2d9b2615c11fa460ed972ad6833c6fd (diff)
downloadbcfg2-354ef30b43098d88173e7132da8a2a7d8fa55bde.tar.gz
bcfg2-354ef30b43098d88173e7132da8a2a7d8fa55bde.tar.bz2
bcfg2-354ef30b43098d88173e7132da8a2a7d8fa55bde.zip
Merge branch 'add-directory-ignore'
-rw-r--r--doc/releases/1.4.0pre2.txt3
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/releases/1.4.0pre2.txt b/doc/releases/1.4.0pre2.txt
index 103af1a0a..5694fe8b4 100644
--- a/doc/releases/1.4.0pre2.txt
+++ b/doc/releases/1.4.0pre2.txt
@@ -46,6 +46,9 @@ backwards-incompatible user-facing changes
your queries default to the class names and the Ldap plugin expires
the metadata caches if the config file changes.
+* Ignore directories containing a .bcfg2-ignore file in various plugins
+ (Bundler, Defaults, Pkgmgr, Properties, PuppetENC, TemplateHelper, Trigger).
+
Thanks
------
diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py
index 762d018eb..ca0fe8188 100644
--- a/src/lib/Bcfg2/Server/Plugin/helpers.py
+++ b/src/lib/Bcfg2/Server/Plugin/helpers.py
@@ -456,7 +456,9 @@ class DirectoryBacked(Debuggable):
# again without having to add a new monitor.
elif os.path.isdir(abspath):
# Deal with events for directories
- if action in ['exists', 'created']:
+ if os.path.exists(os.path.join(abspath, '.bcfg2-ignore')):
+ self.logger.debug("Ignoring directory %s" % abspath)
+ elif action in ['exists', 'created']:
self.add_directory_monitor(relpath)
elif action == 'changed':
if relpath in self.entries: