aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os_net_config/__init__.py1
-rw-r--r--os_net_config/impl_ifcfg.py20
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py4
-rw-r--r--os_net_config/tests/test_objects.py4
-rw-r--r--test-requirements.txt2
5 files changed, 16 insertions, 15 deletions
diff --git a/os_net_config/__init__.py b/os_net_config/__init__.py
index f52eb59..a8fdf43 100644
--- a/os_net_config/__init__.py
+++ b/os_net_config/__init__.py
@@ -40,6 +40,7 @@ class NetConfig(object):
def add_object(self, obj):
"""Convenience method to add any type of object to the network config.
+
See objects.py.
:param obj: The object to add.
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index f2a5dc0..6459bcc 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -30,7 +30,7 @@ def ifcfg_config_path(name):
return "/etc/sysconfig/network-scripts/ifcfg-%s" % name
-#NOTE(dprince): added here for testability
+# NOTE(dprince): added here for testability
def bridge_config_path(name):
return ifcfg_config_path(name)
@@ -414,8 +414,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
ivs_uplinks.append(interface_name)
all_file_names.append(route6_path)
if (utils.diff(interface_path, iface_data) or
- utils.diff(route_path, route_data) or
- utils.diff(route6_path, route6_data)):
+ utils.diff(route_path, route_data) or
+ utils.diff(route6_path, route6_data)):
restart_interfaces.append(interface_name)
restart_interfaces.extend(self.child_members(interface_name))
update_files[interface_path] = iface_data
@@ -436,7 +436,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
all_file_names.append(route6_path)
ivs_interfaces.append(interface_name)
if (utils.diff(interface_path, iface_data) or
- utils.diff(route_path, route_data)):
+ utils.diff(route_path, route_data)):
restart_interfaces.append(interface_name)
restart_interfaces.extend(self.child_members(interface_name))
update_files[interface_path] = iface_data
@@ -476,8 +476,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
all_file_names.append(br_route_path)
all_file_names.append(br_route6_path)
if (utils.diff(bridge_path, bridge_data) or
- utils.diff(br_route_path, route_data) or
- utils.diff(br_route6_path, route6_data)):
+ utils.diff(br_route_path, route_data) or
+ utils.diff(br_route6_path, route6_data)):
restart_bridges.append(bridge_name)
restart_interfaces.extend(self.child_members(bridge_name))
update_files[bridge_path] = bridge_data
@@ -496,8 +496,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
all_file_names.append(br_route_path)
all_file_names.append(br_route6_path)
if (utils.diff(bridge_path, bridge_data) or
- utils.diff(br_route_path, route_data) or
- utils.diff(br_route6_path, route6_data)):
+ utils.diff(br_route_path, route_data) or
+ utils.diff(br_route6_path, route6_data)):
restart_bridges.append(bridge_name)
restart_interfaces.extend(self.child_members(bridge_name))
update_files[bridge_path] = bridge_data
@@ -516,8 +516,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
all_file_names.append(bond_route_path)
all_file_names.append(bond_route6_path)
if (utils.diff(bond_path, bond_data) or
- utils.diff(bond_route_path, route_data) or
- utils.diff(bond_route6_path, route6_data)):
+ utils.diff(bond_route_path, route_data) or
+ utils.diff(bond_route6_path, route6_data)):
restart_linux_bonds.append(bond_name)
restart_interfaces.extend(self.child_members(bond_name))
update_files[bond_path] = bond_data
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py
index e81e049..d68a96e 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -673,7 +673,7 @@ class TestIfcfgNetConfigApply(base.TestCase):
self.assertEqual([], self.ifup_interface_names)
def test_bond_active_slave(self):
- #setup and apply a bond
+ # setup and apply a bond
interface1 = objects.Interface('em1')
interface2 = objects.Interface('em2', primary=True)
bond = objects.OvsBond('bond1', use_dhcp=True,
@@ -686,7 +686,7 @@ class TestIfcfgNetConfigApply(base.TestCase):
self.assertIn(ovs_appctl_cmds, self.ovs_appctl_cmds)
def test_bond_active_ordering(self):
- #setup and apply a bond
+ # setup and apply a bond
interface1 = objects.Interface('em1')
interface2 = objects.Interface('em2')
bond = objects.OvsBond('bond1', use_dhcp=True,
diff --git a/os_net_config/tests/test_objects.py b/os_net_config/tests/test_objects.py
index b49c393..d3e41df 100644
--- a/os_net_config/tests/test_objects.py
+++ b/os_net_config/tests/test_objects.py
@@ -85,8 +85,8 @@ class TestInterface(base.TestCase):
v4_addr = objects.Address('192.168.1.1/24')
v6_addr = objects.Address('2001:abc:a::/64')
interface = objects.Interface('foo', addresses=[v4_addr, v6_addr])
- self.assertEquals("192.168.1.1", interface.v4_addresses()[0].ip)
- self.assertEquals("2001:abc:a::", interface.v6_addresses()[0].ip)
+ self.assertEqual("192.168.1.1", interface.v4_addresses()[0].ip)
+ self.assertEqual("2001:abc:a::", interface.v6_addresses()[0].ip)
def test_from_json_dhcp(self):
data = '{"type": "interface", "name": "em1", "use_dhcp": true}'
diff --git a/test-requirements.txt b/test-requirements.txt
index 07c4914..a0f2371 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,4 +1,4 @@
-hacking>=0.5.6,<0.8
+hacking>=0.10.2,<0.11 # Apache-2.0
coverage>=3.6
discover