From a5a7a80e1043da9e2a0c81d2943e7753dbdca68d Mon Sep 17 00:00:00 2001
From: Pavel Eis <xeispa00@stud.fit.vutbr.cz>
Date: Sat, 16 Sep 2017 13:21:57 +0200
Subject: [PATCH] Fixed error when runned as daemon, mistake was in stripping
 None. Some atributes in IDEA wrapped correctly to list

---
 hp-tipping-point/tpToIdea.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/hp-tipping-point/tpToIdea.py b/hp-tipping-point/tpToIdea.py
index 86408bd..3e1f6de 100644
--- a/hp-tipping-point/tpToIdea.py
+++ b/hp-tipping-point/tpToIdea.py
@@ -193,18 +193,18 @@ class IdeaGen(object):
         target = {}
         if src_ip:
             af = "IP4" if not ':' in src_ip else "IP6"
-            source[af] = src_ip
+            source[af] = [src_ip]
         if src_port:
-            source['Port'] = src_port
+            source['Port'] = [src_port]
         if proto:
-            source['Proto'] = proto
+            source['Proto'] = [proto]
         if url:
             source['url'] = url
         if dest_ip:
             af = "IP4" if not ':' in dest_ip else "IP6"
-            target[af] = dest_ip
+            target[af] = [dest_ip]
         if dest_port:
-            target['Port'] = dest_port
+            target['Port'] = [dest_port]
         if source:
             event['Source'] = [source]
         if target:
@@ -431,7 +431,7 @@ def main():
             for log_file in files:
                 while True:
                     line = log_file.readline()
-                    if not line.strip():
+                    if line is None or not line.strip():
                         logging.info("no line")
                         break
                     logging.info("readline")
-- 
GitLab