Merge pull request #16 from zk-ncc/patch-1

fix plugin.plugin_by_name()
This commit is contained in:
roglew 2017-05-06 20:18:19 -05:00 committed by GitHub
commit cd9b3ef22b

View file

@ -74,8 +74,8 @@ def plugin_by_name(name):
plugin you would call ``plugin_by_name('bar').foo()``.
"""
import pappyproxy.pappy
if name in pappyproxy.pappy.plugin_loader.plugins_by_name:
return pappyproxy.pappy.plugin_loader.plugins_by_name[name].source
if name in pappyproxy.pappy.session.plugin_loader.plugins_by_name:
return pappyproxy.pappy.session.plugin_loader.plugins_by_name[name].source
else:
raise PappyException('No plugin with name %s is loaded' % name)