diff options
-rw-r--r-- | doc/releases/1.4.0pre2.txt | 3 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/NagiosGen.py | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/releases/1.4.0pre2.txt b/doc/releases/1.4.0pre2.txt index 7bbed5603..572748f73 100644 --- a/doc/releases/1.4.0pre2.txt +++ b/doc/releases/1.4.0pre2.txt @@ -17,6 +17,8 @@ and as such is not likely suitable for general production deployment. That said, please help us test the release in non- and preproduction environments. +* NagiosGen: Add bundles to configuration + backwards-incompatible user-facing changes ------------------------------------------ @@ -35,3 +37,4 @@ Special thanks to the following contributors for this release * Alexander Sulfrain * Matt Kemp + * Jeremie Banier diff --git a/src/lib/Bcfg2/Server/Plugins/NagiosGen.py b/src/lib/Bcfg2/Server/Plugins/NagiosGen.py index 045e46350..9d3b3488b 100644 --- a/src/lib/Bcfg2/Server/Plugins/NagiosGen.py +++ b/src/lib/Bcfg2/Server/Plugins/NagiosGen.py @@ -46,6 +46,11 @@ class NagiosGen(Plugin, Generator): metadata.hostname) host_groups = [grp for grp in metadata.groups if os.path.isfile('%s/%s-group.cfg' % (self.data, grp))] + if os.path.isfile('%s/%s-group.cfg' % + (self.data, grp))] + \ + [bundle for bundle in metadata.bundles + if os.path.isfile('%s/%s-bundle.cfg' % + (self.data, bundle))] host_config = ['define host {', self.line_fmt % ('host_name', metadata.hostname), self.line_fmt % ('alias', metadata.hostname), @@ -81,7 +86,8 @@ class NagiosGen(Plugin, Generator): def createserverconfig(self, entry, _): """Build monolithic server configuration file.""" host_configs = glob.glob(os.path.join(self.data, '*-host.cfg')) - group_configs = glob.glob(os.path.join(self.data, '*-group.cfg')) + group_configs = glob.glob(os.path.join(self.data, '*-group.cfg')) + \ + glob.glob(os.path.join(self.data, '*-bundle.cfg')) host_data = [] group_data = [] for host in host_configs: |