Code Review
/
yardstick.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
6d8123f
)
env: convert file open to context manager
89/25589/1
author
Ross Brattain
<ross.b.brattain@intel.com>
Wed, 7 Dec 2016 05:26:16 +0000
(
00:26
-0500)
committer
Ross Brattain
<ross.b.brattain@intel.com>
Wed, 7 Dec 2016 05:26:16 +0000
(
00:26
-0500)
always use context managers to open file
Change-Id: I2c894ea87a94789edbed4a4da1fa906b28556664
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
api/actions/env.py
patch
|
blob
|
history
diff --git
a/api/actions/env.py
b/api/actions/env.py
index
78f9b72
..
fa0f95d
100644
(file)
--- a/
api/actions/env.py
+++ b/
api/actions/env.py
@@
-53,7
+53,8
@@
def _create_grafana():
def _create_dashboard():
url = 'http://admin:admin@%s:3000/api/dashboards/db' % api_conf.GATEWAY_IP
- data = json.load(file('../dashboard/ping_dashboard.json'))
+ with open('../dashboard/ping_dashboard.json') as dashboard_json:
+ data = json.load(dashboard_json)
HttpClient().post(url, data)