Incorrect key name for IPAM options check

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-04-23 18:16:58 -07:00
parent aa66338f39
commit 299ce6ad00
2 changed files with 8 additions and 2 deletions

View File

@ -169,7 +169,7 @@ def check_remote_ipam_config(remote, local):
raise NetworkConfigChangedError(local.full_name, 'IPAM config aux_addresses') raise NetworkConfigChangedError(local.full_name, 'IPAM config aux_addresses')
remote_opts = remote_ipam.get('Options') or {} remote_opts = remote_ipam.get('Options') or {}
local_opts = local.ipam.get('options') or {} local_opts = local.ipam.get('Options') or {}
for k in set.union(set(remote_opts.keys()), set(local_opts.keys())): for k in set.union(set(remote_opts.keys()), set(local_opts.keys())):
if remote_opts.get(k) != local_opts.get(k): if remote_opts.get(k) != local_opts.get(k):
raise NetworkConfigChangedError(local.full_name, 'IPAM option "{}"'.format(k)) raise NetworkConfigChangedError(local.full_name, 'IPAM option "{}"'.format(k))

View File

@ -23,7 +23,10 @@ class NetworkTest(unittest.TestCase):
'aux_addresses': ['11.0.0.1', '24.25.26.27'], 'aux_addresses': ['11.0.0.1', '24.25.26.27'],
'ip_range': '156.0.0.1-254' 'ip_range': '156.0.0.1-254'
} }
] ],
'options': {
'iface': 'eth0',
}
} }
labels = { labels = {
'com.project.tests.istest': 'true', 'com.project.tests.istest': 'true',
@ -57,6 +60,9 @@ class NetworkTest(unittest.TestCase):
'Subnet': '172.0.0.1/16', 'Subnet': '172.0.0.1/16',
'Gateway': '172.0.0.1' 'Gateway': '172.0.0.1'
}], }],
'Options': {
'iface': 'eth0',
},
}, },
'Labels': remote_labels 'Labels': remote_labels
}, },