Merge "Fix swarm monitor exception"

This commit is contained in:
Jenkins 2015-10-14 01:27:25 +00:00 committed by Gerrit Code Review
commit 9eb3a79e6c
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ class SwarmMonitor(MonitorBase):
mem_total += node['MemTotal']
mem_reserved = 0
for container in self.data['containers']:
mem_reserved += container['Config']['Memory']
mem_reserved += container['HostConfig']['Memory']
if mem_total == 0:
return 0

View File

@ -120,7 +120,7 @@ class MonitorsTestCase(base.TestCase):
'containers': [
{
'Name': 'container',
'Config': {
'HostConfig': {
'Memory': 10,
},
},