summaryrefslogtreecommitdiff
path: root/cloudinit/netinfo.py
diff options
context:
space:
mode:
authorAndrew Jorgensen <ajorgens@amazon.com>2017-10-02 12:53:56 -0600
committerChad Smith <chad.smith@canonical.com>2017-10-02 12:53:56 -0600
commitf010594beb75e146091db47b7d72d1fc1d763e98 (patch)
treefa5e47e7d5a53229844be68ee1d47ec784e6603d /cloudinit/netinfo.py
parentd32049993a8e719c52cb491dd8cc7935bfede2d3 (diff)
downloadvyos-cloud-init-f010594beb75e146091db47b7d72d1fc1d763e98.tar.gz
vyos-cloud-init-f010594beb75e146091db47b7d72d1fc1d763e98.zip
Remove prettytable dependency, introduce simpletable
The first revision of this rendered tables with less decoration but there was a desire upstream to avoid possibly breaking some parsing someone might be doing, so it has been revised to render the same as prettytable for the cases cloud-init actually uses.
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 39c79dee..8f99d99c 100644
--- a/cloudinit/netinfo.py
+++ b/cloudinit/netinfo.py
@@ -13,7 +13,7 @@ import re
from cloudinit import log as logging
from cloudinit import util
-from prettytable import PrettyTable
+from cloudinit.simpletable import SimpleTable
LOG = logging.getLogger()
@@ -170,7 +170,7 @@ def netdev_pformat():
lines.append(util.center("Net device info failed", '!', 80))
else:
fields = ['Device', 'Up', 'Address', 'Mask', 'Scope', 'Hw-Address']
- tbl = PrettyTable(fields)
+ tbl = SimpleTable(fields)
for (dev, d) in netdev.items():
tbl.add_row([dev, d["up"], d["addr"], d["mask"], ".", d["hwaddr"]])
if d.get('addr6'):
@@ -194,7 +194,7 @@ def route_pformat():
if routes.get('ipv4'):
fields_v4 = ['Route', 'Destination', 'Gateway',
'Genmask', 'Interface', 'Flags']
- tbl_v4 = PrettyTable(fields_v4)
+ tbl_v4 = SimpleTable(fields_v4)
for (n, r) in enumerate(routes.get('ipv4')):
route_id = str(n)
tbl_v4.add_row([route_id, r['destination'],
@@ -207,7 +207,7 @@ def route_pformat():
if routes.get('ipv6'):
fields_v6 = ['Route', 'Proto', 'Recv-Q', 'Send-Q',
'Local Address', 'Foreign Address', 'State']
- tbl_v6 = PrettyTable(fields_v6)
+ tbl_v6 = SimpleTable(fields_v6)
for (n, r) in enumerate(routes.get('ipv6')):
route_id = str(n)
tbl_v6.add_row([route_id, r['proto'],