From 110861ec9d8cd70dc75ca8ca33b66db8060e761c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 30 Aug 2013 16:03:23 -0400 Subject: XMLFileBacked: Monitor XIncludes whenever a FAM is available This monitors XIncluded files even if should_monitor=False, since the object monitoring the base file will not monitor XIncludes. This ensures that XIncluded files are properly monitored whenever possible, particularly for Bundler and Properties. This is a partial backport of 5b66845 -- as much of a backport as is possible without a module-level FAM object. --- src/lib/Bcfg2/Server/Plugin/helpers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugin/helpers.py') diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py index 81dc1d736..3a994606c 100644 --- a/src/lib/Bcfg2/Server/Plugin/helpers.py +++ b/src/lib/Bcfg2/Server/Plugin/helpers.py @@ -606,15 +606,16 @@ class XMLFileBacked(FileBacked): def add_monitor(self, fpath): """ Add a FAM monitor to a file that has been XIncluded. This - is only done if the constructor got both a ``fam`` object and - ``should_monitor`` set to True. + is only done if the constructor got a ``fam`` object, + regardless of whether ``should_monitor`` is set to True (i.e., + whether or not the base file is monitored). :param fpath: The full path to the file to monitor :type fpath: string :returns: None """ self.extra_monitors.append(fpath) - if self.fam and self.should_monitor: + if self.fam: self.fam.AddMonitor(fpath, self) def __iter__(self): -- cgit v1.2.3-1-g7c22