Code Review
/
integration
/
test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
9d99777
)
Fix open files
12/72012/3
author
Dibya Prakash Das
<dibyadascool@gmail.com>
Tue, 15 May 2018 10:06:02 +0000
(10:06 +0000)
committer
Luis Gomez
<ecelgp@gmail.com>
Wed, 23 May 2018 14:46:14 +0000
(14:46 +0000)
Change-Id: I6ae9a167c6c7f1cabf52871f22c18ef48c10aa78
Signed-off-by: Dibya Prakash Das <dibyadascool@gmail.com>
csit/scripts/push_to_elk.py
patch
|
blob
|
history
diff --git
a/csit/scripts/push_to_elk.py
b/csit/scripts/push_to_elk.py
index 41f4a0b7c6296a081f6aa5ae8aaf9639090f150c..1f6f258ced74e2464215645db16cada843d6b405 100755
(executable)
--- a/
csit/scripts/push_to_elk.py
+++ b/
csit/scripts/push_to_elk.py
@@
-95,7
+95,8
@@
else:
for f in csv_files:
key = (f.split('/')[-1])[:-4]
BODY['plots'][key] = {}
- lines = open(f).readlines()
+ with open(f) as file:
+ lines = file.readlines()
props = lines[0].strip().split(',')
vals = lines[1].strip().split(',')
BODY['plots'][key][props[0]] = float(vals[0])