summaryrefslogtreecommitdiff
path: root/cloudinit/netinfo.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-29 12:28:44 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-29 12:28:44 -0700
commit2d6d386dbd30f70aa0190ed6620404e620e315a9 (patch)
tree54201a1228a2bbaf150aaac41b3fbc93a2b23f7c /cloudinit/netinfo.py
parent197d7d4fee1d402cda0e2054ae48247b4c361f53 (diff)
downloadvyos-cloud-init-2d6d386dbd30f70aa0190ed6620404e620e315a9.tar.gz
vyos-cloud-init-2d6d386dbd30f70aa0190ed6620404e620e315a9.zip
Readd the original prefix to the netinfo (if provided).
Diffstat (limited to 'cloudinit/netinfo.py')
-rw-r--r--cloudinit/netinfo.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py
index a6b9116d..feba5a62 100644
--- a/cloudinit/netinfo.py
+++ b/cloudinit/netinfo.py
@@ -150,8 +150,18 @@ def route_pformat():
return "\n".join(lines)
-def debug_info():
+def debug_info(prefix='ci-info: '):
lines = []
- lines.append(netdev_pformat())
- lines.append(route_pformat())
+ netdev_lines = netdev_pformat().splitlines()
+ if prefix:
+ for line in netdev_lines:
+ lines.append("%s%s" % (prefix, line))
+ else:
+ lines.extend(netdev_lines)
+ route_lines = route_pformat().splitlines()
+ if prefix:
+ for line in route_lines:
+ lines.append("%s%s" % (prefix, line))
+ else:
+ lines.extend(route_lines)
return "\n".join(lines)