Commit ef2a2b73 authored by Daniele Venzano's avatar Daniele Venzano

Sets cannot be "added", need an explicit union() call.

parent 998b9919
......@@ -155,7 +155,7 @@ class DockerClient:
except KeyError:
info['host'] = 'N/A'
if container.status == 'running' or container.status == 'restarting':
if container.status == 'running' or container.status == 'restarting' or container.status == 'removing':
info["state"] = Service.BACKEND_START_STATUS
info["running"] = True
elif container.status == 'paused' or container.status == 'exited' or container.status == 'dead':
......
......@@ -75,7 +75,7 @@ class DockerStateSynchronizer(threading.Thread):
self.host_stats[host_config.name].memory_total = info['MemTotal']
self.host_stats[host_config.name].labels = host_config.labels
if info['Labels'] is not None:
self.host_stats[host_config.name].labels += set(info['Labels'])
self.host_stats[host_config.name].labels.union(set(info['Labels']))
self.host_stats[host_config.name].memory_allocated = sum([cont['memory_soft_limit'] for cont in container_list if cont['memory_soft_limit'] != info['MemTotal']])
self.host_stats[host_config.name].cores_allocated = sum([cont['cpu_quota'] / cont['cpu_period'] for cont in container_list if cont['cpu_period'] != 0])
......@@ -102,7 +102,7 @@ class DockerStateSynchronizer(threading.Thread):
sleep_time = CHECK_INTERVAL - (time.time() - time_start)
if sleep_time <= 0:
log.warning('synchro thread for host {} is late of {:.2f} seconds'.format(host_config.name, sleep_time * -1))
log.warning('synchro thread for host {} is late by {:.2f} seconds'.format(host_config.name, sleep_time * -1))
sleep_time = 0
if self.stop.wait(timeout=sleep_time):
break
......
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