Update to python3
This commit is contained in:
parent
b136bbeb5a
commit
f58707010a
|
@ -30,7 +30,7 @@ output = []
|
|||
|
||||
def calculate_count(data):
|
||||
count = {}
|
||||
ls = data.values()
|
||||
ls = list(data.values())
|
||||
z, nz = 0, 0
|
||||
for v in ls:
|
||||
if v == 0:
|
||||
|
@ -67,14 +67,14 @@ def getMonit():
|
|||
checks[name] = status[name]
|
||||
|
||||
sorted_checks = OrderedDict()
|
||||
sorted_checks = OrderedDict(sorted(checks.iteritems(),
|
||||
sorted_checks = OrderedDict(sorted(iter(checks.items()),
|
||||
key=itemgetter(1), reverse=True))
|
||||
count = calculate_count(sorted_checks)
|
||||
server = dict(name=site, url=s['url'],
|
||||
result=sorted_checks, s_rate=count)
|
||||
|
||||
output.append(server)
|
||||
print(datetime.datetime.now())
|
||||
print((datetime.datetime.now()))
|
||||
return(output)
|
||||
|
||||
# Classes
|
||||
|
|
|
@ -15,7 +15,7 @@ def generate_report_excel(output, filename):
|
|||
worksheet.write('B1', 'Status', bold)
|
||||
row = 1
|
||||
col = 0
|
||||
for key, value in output[server]['result'].items():
|
||||
for key, value in list(output[server]['result'].items()):
|
||||
worksheet.write_string(row, col, key)
|
||||
if value == 0:
|
||||
status = 'OK'
|
||||
|
|
Loading…
Reference in a new issue