Also print total vm count + make result clearer
This commit is contained in:
parent
fc9dbe9e57
commit
7698db24ce
1 changed files with 7 additions and 1 deletions
|
@ -59,8 +59,14 @@ class ungleichPay(object):
|
||||||
if (response_json['response'] == 'success'):
|
if (response_json['response'] == 'success'):
|
||||||
data = response_json["data"]
|
data = response_json["data"]
|
||||||
rows = [(x['email'], x['vm_count']) for x in data]
|
rows = [(x['email'], x['vm_count']) for x in data]
|
||||||
headers = ["email", "vm_count"]
|
headers = ["customer", "vm_count"]
|
||||||
|
print("---")
|
||||||
print(tabulate(rows, headers))
|
print(tabulate(rows, headers))
|
||||||
|
print("---")
|
||||||
|
vm_count = 0
|
||||||
|
for x in data:
|
||||||
|
vm_count += x['vm_count']
|
||||||
|
print("Total vm_count = {}".format(vm_count))
|
||||||
else:
|
else:
|
||||||
print("An error occurred.")
|
print("An error occurred.")
|
||||||
print(response_json["message"])
|
print(response_json["message"])
|
||||||
|
|
Loading…
Reference in a new issue