Ticket #488 (closed defect: fixed)

Opened 16 years ago

Last modified 16 years ago

[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:


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.

---        2007-11-02 13:46:01.561152004 -0400
+++     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 @@
                     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))
                 struct = getattr(mod, plugin)


Change History

comment:1 Changed 16 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed

Applied, thanks.

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.