Merge pull request #5897 from docker/5882-ipam_options_check

Incorrect key name for IPAM options check
This commit is contained in:
Joffrey F 2018-04-24 13:33:42 -07:00 committed by GitHub
commit fa3acbeb8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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')
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())):
if remote_opts.get(k) != local_opts.get(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'],
'ip_range': '156.0.0.1-254'
}
]
],
'options': {
'iface': 'eth0',
}
}
labels = {
'com.project.tests.istest': 'true',
@ -57,6 +60,9 @@ class NetworkTest(unittest.TestCase):
'Subnet': '172.0.0.1/16',
'Gateway': '172.0.0.1'
}],
'Options': {
'iface': 'eth0',
},
},
'Labels': remote_labels
},