Skip to content

Commit

Permalink
improve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dennyzhang committed Jan 2, 2017
1 parent ba99a43 commit 761d09d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jenkins_scripts/report/cloud_cost_slack_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Description :
## --
## Created : <2017-01-01>
## Updated: Time-stamp: <2017-01-02 14:11:17>
## Updated: Time-stamp: <2017-01-02 14:16:39>
##-------------------------------------------------------------------
import os, sys, json
import requests
Expand Down Expand Up @@ -77,9 +77,9 @@ def digitalocean_list_vm(cloud_token):
print "Error to call rest api. response: %s" % (r.text)
sys.exit(1)
response_json = r.json()
vm_list = []
vm_list.append("{0:16} {1:20} {2:20} {3:10}".\
format('ID', 'Name', 'IP', 'Price'))
vm_list = []
for d in response_json['droplets']:
vm_list.append("{0:16} {1:20} {2:20} {3:10}".\
format(str(d["id"]),d["name"], d["networks"]["v4"][0]["ip_address"], \
Expand Down

0 comments on commit 761d09d

Please sign in to comment.