You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by na...@apache.org on 2018/03/19 19:28:16 UTC

[07/42] incubator-spot git commit: Fix dns_oa.py to stop crashing FBThreatExchange

Fix dns_oa.py to stop crashing FBThreatExchange

Stop the start_oa.py script from crashing, while performing reputation check for the dns_results.csv domains. 
https://issues.apache.org/jira/browse/SPOT-238

Project: http://git-wip-us.apache.org/repos/asf/incubator-spot/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spot/commit/3e7b628c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/3e7b628c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/3e7b628c

Branch: refs/heads/SPOT-181_ODM
Commit: 3e7b628cccdefbf021d9b335bd113108880a32ba
Parents: dbf6f51
Author: lighteternal <dp...@gmail.com>
Authored: Tue Oct 31 12:57:29 2017 +0200
Committer: GitHub <no...@github.com>
Committed: Tue Oct 31 12:57:29 2017 +0200

----------------------------------------------------------------------
 spot-oa/oa/dns/dns_oa.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/3e7b628c/spot-oa/oa/dns/dns_oa.py
----------------------------------------------------------------------
diff --git a/spot-oa/oa/dns/dns_oa.py b/spot-oa/oa/dns/dns_oa.py
index 5982e8b..5023d7f 100644
--- a/spot-oa/oa/dns/dns_oa.py
+++ b/spot-oa/oa/dns/dns_oa.py
@@ -232,7 +232,7 @@ class OA(object):
                     rep_results = {k: "{0}::{1}".format(rep_results.get(k, ""), result.get(k, "")).strip('::') for k in set(rep_results) | set(result)}
 
                 if rep_results:
-                    self._dns_scores = [ conn + [ rep_results[conn[key]] ]   for conn in self._dns_scores  ]
+                    self._dns_scores = [ conn + [ rep_results.get(key) ]    for conn in self._dns_scores  ]
                 else:
                     self._dns_scores = [ conn + [""]   for conn in self._dns_scores  ]
         else:
@@ -418,4 +418,4 @@ class OA(object):
             query_to_insert=("""
                 INSERT INTO {0}.dns_ingest_summary PARTITION (y={1}, m={2}, d={3}) VALUES {4};
             """).format(self._db, yr, mn, dy, tuple(df_final))
-            impala.execute_query(query_to_insert)
\ No newline at end of file
+            impala.execute_query(query_to_insert)