If we fail during devstack / grenade runs, it would be nice to have
the map of iptables that are currently active as well. This makes it
handy to start figuring out what's going on when test servers don't
ping.
Change-Id: Ia31736ef2cb0221586d30c089473dfdc1db90e23
| ... | ... |
@@ -61,6 +61,17 @@ File System Summary |
| 61 | 61 |
print dfraw |
| 62 | 62 |
|
| 63 | 63 |
|
| 64 |
+def iptables_dump(): |
|
| 65 |
+ tables = ['filter', 'nat', 'mangle'] |
|
| 66 |
+ print """ |
|
| 67 |
+IP Tables Dump |
|
| 68 |
+=============== |
|
| 69 |
+""" |
|
| 70 |
+ for table in tables: |
|
| 71 |
+ print os.popen("sudo iptables --line-numbers -L -nv -t %s"
|
|
| 72 |
+ % table).read() |
|
| 73 |
+ |
|
| 74 |
+ |
|
| 64 | 75 |
def process_list(): |
| 65 | 76 |
print """ |
| 66 | 77 |
Process Listing |
| ... | ... |
@@ -79,6 +90,7 @@ def main(): |
| 79 | 79 |
os.dup2(f.fileno(), sys.stdout.fileno()) |
| 80 | 80 |
disk_space() |
| 81 | 81 |
process_list() |
| 82 |
+ iptables_dump() |
|
| 82 | 83 |
|
| 83 | 84 |
|
| 84 | 85 |
if __name__ == '__main__': |