summaryrefslogtreecommitdiff
path: root/cloudinit/netinfo.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-15 17:54:52 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-15 17:54:52 -0700
commit34e3285163a3a4a4455dedf81987cc90e089fad7 (patch)
tree06ddfcd46fc30f58c884813f1228c3fa8cd42f75 /cloudinit/netinfo.py
parent9f3a59203ae4e51087fb0ad9ad0fa2ad31302c80 (diff)
downloadvyos-cloud-init-34e3285163a3a4a4455dedf81987cc90e089fad7.tar.gz
vyos-cloud-init-34e3285163a3a4a4455dedf81987cc90e089fad7.zip
Logic test on split up line length (just incase).
Removed un-used pre debug info option, since this is not used in the prettytable case.
Diffstat (limited to 'cloudinit/netinfo.py')
-rw-r--r--cloudinit/netinfo.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py
index 874c2674..0d729502 100644
--- a/cloudinit/netinfo.py
+++ b/cloudinit/netinfo.py
@@ -82,7 +82,7 @@ def route_info():
if not line:
continue
toks = line.split()
- if toks[0] == "Kernel" or toks[0] == "Destination":
+ if len(toks) < 8 or toks[0] == "Kernel" or toks[0] == "Destination":
continue
entry = {
'destination': toks[0],
@@ -140,9 +140,9 @@ def route_pformat():
fields = ['Route', 'Destination', 'Gateway',
'Genmask', 'Interface', 'Flags']
tbl = PrettyTable(fields)
- for n, r in enumerate(routes):
+ for (n, r) in enumerate(routes):
route_id = str(n)
- tbl.add_row([str(n), r['destination'],
+ tbl.add_row([route_id, r['destination'],
r['gateway'], r['genmask'],
r['iface'], r['flags']])
route_s = tbl.get_string()
@@ -152,7 +152,7 @@ def route_pformat():
return os.linesep.join(lines)
-def debug_info(pre=""):
+def debug_info():
lines = []
lines.append(netdev_pformat())
lines.append(route_pformat())