mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 02:28:23 +00:00
fix: [IPAdress module] empty queue if no IP ranges provided
This commit is contained in:
parent
b64c70e0cd
commit
c02b9f2a81
1 changed files with 12 additions and 8 deletions
|
@ -43,7 +43,8 @@ class IPAddress(AbstractModule):
|
||||||
networks = config_loader.get_config_str("IP", "networks")
|
networks = config_loader.get_config_str("IP", "networks")
|
||||||
if not networks:
|
if not networks:
|
||||||
print('No IP ranges provided')
|
print('No IP ranges provided')
|
||||||
sys.exit(0)
|
# sys.exit(0)
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
for network in networks.split(","):
|
for network in networks.split(","):
|
||||||
self.ip_networks.add(IPv4Network(network))
|
self.ip_networks.add(IPv4Network(network))
|
||||||
|
@ -62,6 +63,9 @@ class IPAddress(AbstractModule):
|
||||||
self.logger.info(f"Module {self.module_name} initialized")
|
self.logger.info(f"Module {self.module_name} initialized")
|
||||||
|
|
||||||
def compute(self, message, r_result=False):
|
def compute(self, message, r_result=False):
|
||||||
|
if not self.ip_networks:
|
||||||
|
return None
|
||||||
|
|
||||||
item = Item(message)
|
item = Item(message)
|
||||||
content = item.get_content()
|
content = item.get_content()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue