From fa25b112ec93f96eee47e7522047bafe29d2e92f Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 12 Sep 2012 16:53:53 -0400 Subject: bcfg2-info: added "automatch" command to perform Properties automatching --- src/lib/Bcfg2/Server/Plugins/Properties.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Properties.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py index 49500e915..5b48a2b8f 100644 --- a/src/lib/Bcfg2/Server/Plugins/Properties.py +++ b/src/lib/Bcfg2/Server/Plugins/Properties.py @@ -16,6 +16,7 @@ logger = logging.getLogger(__name__) SETUP = None + class PropertyFile(Bcfg2.Server.Plugin.StructFile): """Class for properties files.""" def write(self): @@ -124,11 +125,11 @@ class Properties(Bcfg2.Server.Plugin.Plugin, SETUP = core.setup def get_additional_data(self, metadata): - autowatch = self.core.setup.cfp.getboolean("properties", "automatch", + automatch = self.core.setup.cfp.getboolean("properties", "automatch", default=False) rv = dict() for fname, pfile in self.store.entries.items(): - if (autowatch or + if (automatch or pfile.xdata.get("automatch", "false").lower() == "true"): rv[fname] = pfile.XMLMatch(metadata) else: -- cgit v1.2.3-1-g7c22