Ticket #1160: NagiosGen.patch

File NagiosGen.patch, 1.4 KB (added by https://www.google.com/accounts/o8/id?id=AItOawnQrJGA5cTPlSuMy-jZCtsSBGfqOtNfvzQ, 8 years ago)

patch file since the web stuff seems scrambled.

  • NagiosGen.py

    old new  
    4949            raise Bcfg2.Server.Plugin.PluginExecutionError 
    5050        host_groups = [grp for grp in metadata.groups 
    5151                       if os.path.isfile('%s/%s-group.cfg' % (self.data, grp))] 
    52         host_groups.append([bundle for bundle in metadata.bundles 
    53                        if os.path.isfile('%s/%s-bundle.cfg' % (self.data, bundle))]) 
    54          
     52        bundle_groups = [grp for grp in metadata.bundles 
     53                       if os.path.isfile('%s/%s-bundle.cfg' % (self.data, grp))] 
     54        host_groups = bundle_groups + host_groups 
    5555        host_config = ['define host {', 
    5656                       self.line_fmt % ('host_name', metadata.hostname), 
    5757                       self.line_fmt % ('alias', metadata.hostname), 
     
    8787    def createserverconfig(self, entry, _): 
    8888        """Build monolithic server configuration file.""" 
    8989        host_configs = glob.glob(os.path.join(self.data, '*-host.cfg')) 
    90         group_configs = glob.glob(os.path.join(self.data, '*-group.cfg')) 
     90        group_configs = glob.glob(os.path.join(self.data, '*-group.cfg')) + glob.glob(os.path.join(self.data, '*-bundle.cfg')) 
     91 
    9192        host_data = [] 
    9293        group_data = [] 
    9394        for host in host_configs: