Modify ↓
Ticket #488 (closed defect: fixed)
[patch] Fix config parsing problem with spaces
Reported by: | [email protected]… | Owned by: | desai |
---|---|---|---|
Priority: | minor | Milestone: | Bcfg2 0.9.5 Release |
Component: | bcfg2-server | Version: | 0.9.x |
Keywords: | Cc: |
Description
This patch enables to parse the 'generators' line in the config file if a space is present in the list :
generators = SSHbase,Cfg,Pkgmgr,Svcmgr,Rules, TCheetah
It also prints a more detailed message if a plugin fails to load.
--- Core.py.orig 2007-11-02 13:46:01.561152004 -0400 +++ Core.py 2007-11-02 13:53:13.504033956 -0400 @@ -223,8 +223,8 @@ mpath = self.cfile.get('server','repository') self.stats = Statistics("%s/etc/statistics.xml" % (mpath)) - structures = self.cfile.get('server', 'structures').split(',') - generators = self.cfile.get('server', 'generators').split(',') + structures = self.cfile.get('server', 'structures').replace(' ', '').split(',') + generators = self.cfile.get('server', 'generators').replace(' ', '').split(',') [data.remove('') for data in [structures, generators] if '' in data] for plugin in structures + generators + ['Metadata']: @@ -232,8 +232,8 @@ try: mod = getattr(__import__("Bcfg2.Server.Plugins.%s" % (plugin)).Server.Plugins, plugin) - except ImportError: - logger.error("Failed to load plugin %s" % (plugin)) + except ImportError, e: + logger.error("Failed to load plugin %s: %s" % (plugin, e)) continue struct = getattr(mod, plugin) try:
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
Applied, thanks.