Ticket #875 (closed enhancement: fixed)
Useless traceback in syslog for incorrect Pkgmgr with Packages
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawlzX5Tg6BOlMOP5kAO1OAM4dDKQLSCopiU | Owned by: | solj |
---|---|---|---|
Priority: | minor | Milestone: | Bcfg2 1.1.0 Release |
Component: | bcfg2-server | Version: | 1.0 |
Keywords: | Cc: | [email protected]… |
Description
I followed the BCFG2 Ubuntu from scratch tutorial found here at http://trac.mcs.anl.gov/projects/bcfg2/wiki/QuickStart/Ubuntu and I encountered an error where I incorrectly configured my bcfg2.conf file to have both Pkgmgr an Packages plugins installed simultaniously, causing issues with some bundles. A syslog of the output can be found here: http://dl.dropbox.com/u/56654/syslogtail.log
The syslog error was a bit confusing, perhaps a more useful error message could be displayed or the problem brought up in debug mode? My own error was found by <solj> on the irc channel and he suggested I file this ticket.
Thanks,
Andrew Younge
Attachments
Change History
Changed 13 years ago by https://www.google.com/accounts/o8/id?id=AItOawlzX5Tg6BOlMOP5kAO1OAM4dDKQLSCopiU
- Attachment syslogtail.log added
comment:1 Changed 13 years ago by solj
- Owner changed from desai to solj
- Status changed from new to accepted
- Milestone changed from Bcfg2 1.2.0 Release to Bcfg2 1.1.0 Release
comment:2 in reply to: ↑ description Changed 13 years ago by solj
Replying to https://www.google.com/accounts/o8/id?id=AItOawlzX5Tg6BOlMOP5kAO1OAM4dDKQLSCopiU:
I followed the BCFG2 Ubuntu from scratch tutorial found here at http://trac.mcs.anl.gov/projects/bcfg2/wiki/QuickStart/Ubuntu and I encountered an error where I incorrectly configured my bcfg2.conf file to have both Pkgmgr an Packages plugins installed simultaniously, causing issues with some bundles. A syslog of the output can be found here: http://dl.dropbox.com/u/56654/syslogtail.log
The syslog error was a bit confusing, perhaps a more useful error message could be displayed or the problem brought up in debug mode? My own error was found by <solj> on the irc channel and he suggested I file this ticket.
Thanks,
Andrew Younge
Can you try the following patch:
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py index 712c87c..4c02c6b 100644 --- a/src/lib/Server/Core.py +++ b/src/lib/Server/Core.py @@ -129,6 +129,14 @@ class Core(Component): logger.error("Failed to load plugin %s" % (plugin)) return plug = getattr(mod, plugin) + # check for conflicting plugins before loading them + if plug.conflicts: + bplugs = [conflict for conflict in plug.conflicts + if conflict in self.plugins] + if bplugs: + logger.error("Plugin %s conflicts with %s; not " + "loading" % (plugin, bplugs)) + return try: self.plugins[plugin] = plug(self, self.datastore) except PluginInitError: diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 2e4974a..f3b97b3 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -56,6 +56,7 @@ class Plugin(object): __rmi__ = ['toggle_debug'] experimental = False deprecated = False + conflicts = [] def __init__(self, core, datastore): object.__init__(self) diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py index 7c334be..cd3480a 100644 --- a/src/lib/Server/Plugins/Pkgmgr.py +++ b/src/lib/Server/Plugins/Pkgmgr.py @@ -123,6 +123,7 @@ class Pkgmgr(Bcfg2.Server.Plugin.PrioDir): __author__ = '[email protected]' __child__ = PkgSrc __element__ = 'Package' + conflicts = ['Packages'] def HandleEvent(self, event): '''Handle events and update dispatch table'''
tail 200 lines form /var/log/syslog