PR#445 log failed plugin
Merges #445 https://pagure.io/koji/pull-request/445 Fixes #433 https://pagure.io/koji/issue/433
This commit is contained in:
commit
6165d5dda3
2 changed files with 12 additions and 2 deletions
|
|
@ -572,7 +572,10 @@ def get_policy(opts, plugins):
|
|||
alltests = [koji.policy.findSimpleTests([vars(kojihub), vars(koji.policy)])]
|
||||
# we delay merging these to allow a test to be overridden for a specific policy
|
||||
for plugin_name in opts.get('Plugins', '').split():
|
||||
alltests.append(koji.policy.findSimpleTests(vars(plugins.get(plugin_name))))
|
||||
plugin = plugins.get(plugin_name)
|
||||
if not plugin:
|
||||
continue
|
||||
alltests.append(koji.policy.findSimpleTests(vars(plugin)))
|
||||
policy = {}
|
||||
for pname, text in opts['policy'].iteritems():
|
||||
#filter/merge tests
|
||||
|
|
@ -813,5 +816,8 @@ def get_registry(opts, plugins):
|
|||
registry.register_function(koji.auth.exclusiveSession)
|
||||
registry.register_function(koji.auth.sharedSession)
|
||||
for name in opts.get('Plugins', '').split():
|
||||
registry.register_plugin(plugins.get(name))
|
||||
plugin = plugins.get(name)
|
||||
if not plugin:
|
||||
continue
|
||||
registry.register_plugin(plugin)
|
||||
return registry
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ class PluginTracker(object):
|
|||
file, pathname, description = imp.find_module(name, self.pathlist(path))
|
||||
try:
|
||||
plugin = imp.load_module(mod_name, file, pathname, description)
|
||||
except Exception:
|
||||
msg = 'Loading plugin %s failed' % name
|
||||
logging.getLogger('koji.plugin').error(msg)
|
||||
raise
|
||||
finally:
|
||||
file.close()
|
||||
self.plugins[name] = plugin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue