From 2d6d386dbd30f70aa0190ed6620404e620e315a9 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 29 Jun 2012 12:28:44 -0700 Subject: Readd the original prefix to the netinfo (if provided). --- cloudinit/netinfo.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'cloudinit') 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) -- cgit v1.2.3