diff options
author | 2015-09-24 19:05:36 +0000 | |
---|---|---|
committer | 2015-09-24 19:05:36 +0000 | |
commit | 32b2a365f391d44247b94d6b7a4bda39d597340a (patch) | |
tree | cfe444aad4601d64dd78ee6e0758988e20f3b74a | |
parent | 64123ba0e7ddda112b646bfa5e48f15402921350 (diff) | |
parent | 5e48946bcc863bb8a5f19f1c96f11355ba84e96c (diff) |
Merge "os-net-config: ensure ifup is called just once"
-rw-r--r-- | os_net_config/impl_ifcfg.py | 2 | ||||
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 99273bc..4cacbf8 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -62,7 +62,7 @@ class IfcfgNetConfig(os_net_config.NetConfig): children.add(member) children.update(self.child_members(member)) except KeyError: - children.add(name) + pass return children def _add_common(self, base_opt): diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index e32aff2..3a77ee9 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -489,6 +489,15 @@ class TestIfcfgNetConfigApply(base.TestCase): self.assertIn('em1', self.ifup_interface_names) self.assertIn('em2', self.ifup_interface_names) + def test_restart_interface_counts(self): + interface = objects.Interface('em1') + self.provider.add_interface(interface) + interface2 = objects.Interface('em2') + self.provider.add_interface(interface2) + self.provider.apply() + self.assertEqual(1, self.ifup_interface_names.count("em1")) + self.assertEqual(1, self.ifup_interface_names.count("em2")) + def test_vlan_apply(self): vlan = objects.Vlan('em1', 5) self.provider.add_vlan(vlan) |