Просмотр исходного кода

Incorrect key name for IPAM options check

Signed-off-by: Joffrey F <[email protected]>
Joffrey F 7 лет назад
Родитель
Сommit
299ce6ad00
2 измененных файлов с 8 добавлено и 2 удалено
  1. 1 1
      compose/network.py
  2. 7 1
      tests/unit/network_test.py

+ 1 - 1
compose/network.py

@@ -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))

+ 7 - 1
tests/unit/network_test.py

@@ -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
             },