Add conf_requires.
Load plugins in order
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user