From dbc5e0d190ecfb3b047e133294b8d1e6ef451c46 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 19 Jun 2012 14:17:52 -0400 Subject: added automatch to automatically invoke XMLMatch() on Properties files --- src/lib/Bcfg2/Server/Plugins/Properties.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py index 33c9e1909..8d3e049d4 100644 --- a/src/lib/Bcfg2/Server/Plugins/Properties.py +++ b/src/lib/Bcfg2/Server/Plugins/Properties.py @@ -128,5 +128,13 @@ class Properties(Bcfg2.Server.Plugin.Plugin, SETUP = core.setup - def get_additional_data(self, _): - return copy.copy(self.store.entries) + def get_additional_data(self, metadata): + autowatch = self.core.setup.cfp.getboolean("properties", "automatch") + rv = dict() + for fname, pfile in self.store.entries.items(): + if autowatch or pfile.xdata.get("automatch", + "false").lower() == "true": + rv[fname] = pfile.XMLMatch(metadata) + else: + rv[fname] = copy.copy(pfile) + return rv -- cgit v1.2.3-1-g7c22