Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Commit 0804e35

Browse files
authored
Remove class import as it shadows the module name and causes an error. (#237)
1 parent 295aa49 commit 0804e35

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cli/raft_local.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import requests
1212
import logging
1313

14-
from datetime import datetime
1514
from dateutil import parser as DateParser
1615
from subprocess import PIPE
1716
from raft_sdk.raft_common import RaftJsonDict, get_version
@@ -174,7 +173,7 @@ def common_custom_dimensions(self, units, count):
174173
return {
175174
'SiteHash' : str(uuid.getnode()),
176175
'Source' : self.source,
177-
'TimeStamp' : datetime.utcnow().strftime("%d/%m/%Y %H:%M:%S"),
176+
'TimeStamp' : datetime.datetime.utcnow().strftime("%d/%m/%Y %H:%M:%S"),
178177
'Units' : units,
179178
'Version' : get_version(),
180179
'Count' : count
@@ -195,8 +194,15 @@ def log_bugs_found_telemetry(self, toolname, units, count):
195194
# Record how many bugs were found by each tool
196195
def log_bugs_per_tool(self):
197196
tools = {}
197+
198198
for bug in self.bugs:
199-
toolname = bug['Message']['Tool']
199+
# When running locally in raft-action the key is
200+
# Data instead of Message.
201+
if 'Message' in bug:
202+
key = 'Message'
203+
else:
204+
key = 'Data'
205+
toolname = bug[key]['Tool']
200206
if toolname in tools:
201207
tools[toolname] += 1
202208
else:

0 commit comments

Comments
 (0)