diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-19 14:17:52 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-19 14:17:52 -0400 |
commit | dbc5e0d190ecfb3b047e133294b8d1e6ef451c46 (patch) | |
tree | 5ddaf9b4f46c3270ce1fec652514100d6cd4194c /src/lib/Bcfg2/Server/Plugins | |
parent | 3c2fef87e14a05f9f4deff93ee6d9fbbcfc47ec5 (diff) | |
download | bcfg2-dbc5e0d190ecfb3b047e133294b8d1e6ef451c46.tar.gz bcfg2-dbc5e0d190ecfb3b047e133294b8d1e6ef451c46.tar.bz2 bcfg2-dbc5e0d190ecfb3b047e133294b8d1e6ef451c46.zip |
added automatch to automatically invoke XMLMatch() on Properties files
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Properties.py | 12 |
1 files changed, 10 insertions, 2 deletions
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 |