Fix sel parsing

This adds some fixes to the sel parsing for providing bad output for
policy table matches, and when parsing BMC api dumps in a file. The
tool now has assurances that it is indeed parsing a sel entry and not
callouts, or other API endpoints by ignoring any api entry that's not in
the /logging/entry space.

Signed-off-by: Justin Thaler <thalerj@us.ibm.com>
Change-Id: I7bde829232fd8dd6edcf9b6b25492e1c1b6a663c
diff --git a/thalerj/openbmctool.py b/thalerj/openbmctool.py
index 2710ba3..63c4a3f 100755
--- a/thalerj/openbmctool.py
+++ b/thalerj/openbmctool.py
@@ -934,11 +934,14 @@
     eselSeverity = None
 
     'prepare and sort the event entries'
+    sels = {}
     for key in selEntries:
+        if '/xyz/openbmc_project/logging/entry/' not in key: continue
         if 'callout' not in key:
-            selEntries[key]['logNum'] = key.split('/')[-1]
-            selEntries[key]['timestamp'] = selEntries[key]['Timestamp']
-    sortedEntries = sortSELs(selEntries)
+            sels[key] = selEntries[key]
+            sels[key]['logNum'] = key.split('/')[-1]
+            sels[key]['timestamp'] = selEntries[key]['Timestamp']
+    sortedEntries = sortSELs(sels)
     logNumList = sortedEntries[0]
     eventKeyDict = sortedEntries[1]
 
@@ -1007,7 +1010,7 @@
                     fruCallout = str(addDataPiece[i]).split('=')[1].strip()
 
             if(calloutFound):
-                if fruCallout != "":
+                if fruCallout.strip() != "":
                     policyKey = messageID +"||" +  fruCallout
 
                     # Also use the severity for hostboot errors