Commit 1557e147 authored by Daniele Venzano's avatar Daniele Venzano

Fix problem with host labels

parent a9b02518
......@@ -73,8 +73,9 @@ class DockerStateSynchronizer(threading.Thread):
self.host_stats[].container_count = info['Containers']
self.host_stats[].cores_total = info['NCPU']
self.host_stats[].memory_total = info['MemTotal']
self.host_stats[].labels = host_config.labels
if info['Labels'] is not None:
self.host_stats[].labels = host_config.labels + set(info['Labels'])
self.host_stats[].labels += set(info['Labels'])
self.host_stats[].memory_allocated = sum([cont['memory_soft_limit'] for cont in container_list if cont['memory_soft_limit'] != info['MemTotal']])
self.host_stats[].cores_allocated = sum([cont['cpu_quota'] / cont['cpu_period'] for cont in container_list if cont['cpu_period'] != 0])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment