Skip to content

Commit 358c7ff

Browse files
Fix Server Error (500) on the cloudstats page (#109)
1 parent d0722d8 commit 358c7ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cloudstats/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def index(request):
3333
)
3434
stats_running_cores = prom.query_last(query_count_cores)
3535
for line in stats_running_cores:
36-
all_projects[line['metric']['project_name']]['running_cores'] = float(line['value'][1])
36+
all_projects.setdefault(line['metric']['project_name'], {})['running_cores'] = float(line['value'][1])
3737

3838
query_used_cores = 'sum(rate(libvirtd_domain_vcpu_time{{ {filter} }}[1h])/1000/1000/1000) by (project_name)'.format(
3939
filter=prom.get_filter('cloudstats'),

0 commit comments

Comments
 (0)