From 37b01c2f5e972ff30483194c2683bbbc49a967c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20K=C3=A1cha?= <ph@cesnet.cz> Date: Thu, 3 Oct 2019 16:23:35 +0200 Subject: [PATCH] Update to newer IntelMQ --- intelmq/bots/outputs/files/output.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/intelmq/bots/outputs/files/output.py b/intelmq/bots/outputs/files/output.py index ea73cf9..f5b559f 100644 --- a/intelmq/bots/outputs/files/output.py +++ b/intelmq/bots/outputs/files/output.py @@ -1,13 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from __future__ import unicode_literals import io import socket import time import errno import os from os import path -from sys import argv from intelmq.lib.bot import Bot from intelmq.lib.exceptions import ConfigurationError @@ -61,16 +59,12 @@ class FilesOutputBot(Bot): # Now we know the device/inode, rename to make unique within system newname = self._get_new_name(fd) os.rename(path.join(self.tmp, tmpname), path.join(self.tmp, newname)) - nf = io.open(fd, "w", encoding="utf-8") + nf = io.open(fd, "w", encoding="utf-8") # FIXME (py3) return nf, newname def process(self): event = self.receive_message() - if not event: - self.acknowledge_message() - return - event_data = event.to_json() f, name = self.create_unique_file() f.write(event_data) @@ -80,6 +74,4 @@ class FilesOutputBot(Bot): self.acknowledge_message() -if __name__ == "__main__": - bot = FilesOutputBot(argv[1]) - bot.start() +BOT = FilesOutputBot -- GitLab