Add conf_requires.

Load plugins in order
This commit is contained in:
Grégory Soutadé
2014-11-27 12:34:42 +01:00
parent dd8349ab08
commit 9fbc5448bc
7 changed files with 60 additions and 35 deletions

View File

@@ -10,6 +10,7 @@ class IWLAPostAnalysisReferers(IPlugin):
def __init__(self, iwla):
super(IWLAPostAnalysisReferers, self).__init__(iwla)
self.API_VERSION = 1
self.conf_requires = ['domain_name']
def _getSearchEngine(self, hashid):
for (k, e) in self.search_engines.items():
@@ -22,7 +23,7 @@ class IWLAPostAnalysisReferers(IPlugin):
domain_name = self.iwla.getConfValue('domain_name', '')
if not domain_name:
print 'domain_name required in conf'
print 'domain_name must not be empty !'
return False
self.own_domain_re = re.compile(r'.*%s.*' % (domain_name))

View File

@@ -4,12 +4,15 @@ from iwla import IWLA
from iplugin import IPlugin
class IWLAPostAnalysisReverseDNS(IPlugin):
DEFAULT_DNS_TIMEOUT = 0.5
def __init__(self, iwla):
super(IWLAPostAnalysisReverseDNS, self).__init__(iwla)
self.API_VERSION = 1
def load(self):
timeout = self.iwla.getConfValue('reverse_dns_timeout', 0.5)
timeout = self.iwla.getConfValue('reverse_dns_timeout',
IWLAPostAnalysisReverseDNS.DEFAULT_DNS_TIMEOUT)
socket.setdefaulttimeout(timeout)
return True