Fix swarm monitor exception
In docker 1.8 (atomic-6) image, docker inspect returns Memory information in 'HostConfig section', this patch will adopt that changes. Depend on: I009d8034335f54063a51b8d1395ddc6891a12346 Change-Id: I63ee2393c106d59286f49f88c85c6cba0a57ae15 Closes-Bug: #1504715
This commit is contained in:
parent
bc0c1a4644
commit
c818df26c0
|
@ -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
|
||||
|
|
|
@ -120,7 +120,7 @@ class MonitorsTestCase(base.TestCase):
|
|||
'containers': [
|
||||
{
|
||||
'Name': 'container',
|
||||
'Config': {
|
||||
'HostConfig': {
|
||||
'Memory': 10,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue