summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-02-22 12:21:29 +0100
committerSoren Hansen <soren@linux2go.dk>2011-02-22 12:21:29 +0100
commitb5e6601f76d64a96d6c7de5e9acdf5a8cf0fe8e9 (patch)
treeb2ff9d69633d3d24e42ba01fce8cc27bc664dbb2 /nova
parent54f2362d09393ad6ccdfee5689d4f547c69b3f42 (diff)
PEP8 adjustments.
Diffstat (limited to 'nova')
-rw-r--r--nova/network/linux_net.py9
-rw-r--r--nova/tests/test_network.py10
2 files changed, 9 insertions, 10 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
index 5f480f633..7c4c16810 100644
--- a/nova/network/linux_net.py
+++ b/nova/network/linux_net.py
@@ -261,14 +261,14 @@ class IptablesManager(object):
self.ipv4['nat'].add_rule('POSTROUTING', '-j nova-postrouting-bottom',
wrap=False)
-
# We add a SNATTING chain to the shared nova-postrouting-bottom chain
# so that it's applied last.
self.ipv4['nat'].add_chain('SNATTING')
- self.ipv4['nat'].add_rule('nova-postrouting-bottom', '-j $SNATTING', wrap=False)
+ self.ipv4['nat'].add_rule('nova-postrouting-bottom', '-j $SNATTING',
+ wrap=False)
- # And then we add a floating-ip-snat chain and jump to first thing in the SNATTING
- # chain.
+ # And then we add a floating-ip-snat chain and jump to first thing in
+ # the SNATTING chain.
self.ipv4['nat'].add_chain('floating-ip-snat')
self.ipv4['nat'].add_rule('SNATTING', '-j $floating-ip-snat')
@@ -331,6 +331,7 @@ class IptablesManager(object):
for name in chains]
seen_lines = set()
+
def _weed_out_duplicates(line):
if line in seen_lines:
return False
diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py
index afd38272d..2bdf3709e 100644
--- a/nova/tests/test_network.py
+++ b/nova/tests/test_network.py
@@ -89,7 +89,6 @@ COMMIT
super(IptablesManagerTestCase, self).setUp()
self.manager = linux_net.IptablesManager()
-
def test_filter_rules_are_wrapped(self):
current_lines = self.sample_filter.split('\n')
@@ -114,8 +113,8 @@ COMMIT
':nova-compute-SNATTING - [0:0]',
':nova-compute-PREROUTING - [0:0]',
':nova-compute-POSTROUTING - [0:0]']:
- self.assertTrue(line in new_lines, "One of nova-compute's chains "
- "went missing.")
+ self.assertTrue(line in new_lines, "One of nova-compute's chains "
+ "went missing.")
seen_lines = set()
for line in new_lines:
@@ -138,7 +137,6 @@ COMMIT
% (chain, chain) in new_lines,
"Built-in chain %s not wrapped" % (chain,))
-
def test_filter_rules(self):
current_lines = self.sample_filter.split('\n')
new_lines = self.manager._modify_rules(current_lines,
@@ -148,8 +146,8 @@ COMMIT
':nova-compute-INPUT - [0:0]',
':nova-compute-local - [0:0]',
':nova-compute-OUTPUT - [0:0]']:
- self.assertTrue(line in new_lines, "One of nova-compute's chains"
- " went missing.")
+ self.assertTrue(line in new_lines, "One of nova-compute's chains"
+ " went missing.")
seen_lines = set()
for line in new_lines: