Skip to content

Commit

Permalink
Fix plugin imports on Linux pt4
Browse files Browse the repository at this point in the history
  • Loading branch information
nabla-c0d3 committed Sep 21, 2014
1 parent 34b011b commit e018797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/PluginChromeSha1Deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
from utils.SSLyzeSSLConnection import create_sslyze_connection
from nassl.SslClient import ClientCertificateRequested

# We have to import it this way or PluginCertInfo gets detected twice by SSLyze on Linux
import plugins.PluginCertInfo
from plugins.PluginCertInfo import MOZILLA_STORE_PATH

from plugins.PluginCertInfo import MOZILLA_STORE_PATH, PluginCertInfo

ROOT_CERTS = []

Expand Down
4 changes: 4 additions & 0 deletions plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def __init__(self):
# Check every declaration in that module
for name in dir(module):
obj = getattr(module, name)
if name not in module.__name__:
# Plugins have to have the same class name as their module name
# This prevents Plugin B from being detected twice when there is a Plugin A that imports Plugin B
continue

if inspect.isclass(obj):
# A class declaration was found in that module
Expand Down

0 comments on commit e018797

Please sign in to comment.