summaryrefslogtreecommitdiff
path: root/cloudinit/netinfo.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-01-23 15:35:12 -0500
committerScott Moser <smoser@ubuntu.com>2014-01-23 15:35:12 -0500
commitc2b41f399778213414aa8a9a7f39a03a15ed79df (patch)
tree121efc29dfc73d1f1a1367ee1c5b58453e920efa /cloudinit/netinfo.py
parent84ad0fd0a5471d650c039241286be17cc1163df6 (diff)
downloadcloud-init-git-c2b41f399778213414aa8a9a7f39a03a15ed79df.tar.gz
pep8
Diffstat (limited to 'cloudinit/netinfo.py')
-rw-r--r--cloudinit/netinfo.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py
index a9c3090e..63f720e4 100644
--- a/cloudinit/netinfo.py
+++ b/cloudinit/netinfo.py
@@ -64,11 +64,11 @@ def netdev_info(empty=""):
"""
ifconfigfields = {
- "addr:":"addr", "inet":"addr",
- "bcast:":"bcast", "broadcast":"bcast",
- "mask:":"mask", "netmask":"mask"
+ "addr:": "addr", "inet": "addr",
+ "bcast:": "bcast", "broadcast": "bcast",
+ "mask:": "mask", "netmask": "mask"
}
- for origfield, field in ifconfigfields.items():
+ for origfield, field in ifconfigfields.items():
target = "%s%s" % (field, fieldpost)
if devs[curdev].get(target, ""):
continue
@@ -88,9 +88,6 @@ def netdev_info(empty=""):
return devs
-#
-# Use netstat instead of route since that produces more portable output.
-#
def route_info():
(route_out, _err) = util.subp(["netstat", "-rn"])
@@ -105,11 +102,11 @@ def route_info():
FreeBSD shows 6 items in the routing table:
Destination Gateway Flags Refs Use Netif Expire
default 10.65.0.1 UGS 0 34920 vtnet0
-
+
Linux netstat shows 2 more:
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.65.0.1 0.0.0.0 UG 0 0 0 eth0
- """
+ """
if len(toks) < 6 or toks[0] == "Kernel" or toks[0] == "Destination" or toks[0] == "Internet" or toks[0] == "Internet6" or toks[0] == "Routing":
continue