diff options
author | Andrew Jorgensen <ajorgens@amazon.com> | 2017-10-02 12:53:56 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2017-10-02 12:53:56 -0600 |
commit | f010594beb75e146091db47b7d72d1fc1d763e98 (patch) | |
tree | fa5e47e7d5a53229844be68ee1d47ec784e6603d | |
parent | d32049993a8e719c52cb491dd8cc7935bfede2d3 (diff) | |
download | vyos-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.
-rwxr-xr-x | cloudinit/config/cc_ssh_authkey_fingerprints.py | 4 | ||||
-rw-r--r-- | cloudinit/netinfo.py | 8 | ||||
-rw-r--r-- | packages/pkg-deps.json | 3 | ||||
-rw-r--r-- | requirements.txt | 3 | ||||
-rwxr-xr-x | tools/build-on-freebsd | 1 | ||||
-rw-r--r-- | tox.ini | 3 |
6 files changed, 6 insertions, 16 deletions
diff --git a/cloudinit/config/cc_ssh_authkey_fingerprints.py b/cloudinit/config/cc_ssh_authkey_fingerprints.py index 0066e97f..35d8c57f 100755 --- a/cloudinit/config/cc_ssh_authkey_fingerprints.py +++ b/cloudinit/config/cc_ssh_authkey_fingerprints.py @@ -28,7 +28,7 @@ the keys can be specified, but defaults to ``md5``. import base64 import hashlib -from prettytable import PrettyTable +from cloudinit.simpletable import SimpleTable from cloudinit.distros import ug_util from cloudinit import ssh_util @@ -74,7 +74,7 @@ def _pprint_key_entries(user, key_fn, key_entries, hash_meth='md5', return tbl_fields = ['Keytype', 'Fingerprint (%s)' % (hash_meth), 'Options', 'Comment'] - tbl = PrettyTable(tbl_fields) + tbl = SimpleTable(tbl_fields) for entry in key_entries: if _is_printable_key(entry): row = [] 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'], diff --git a/packages/pkg-deps.json b/packages/pkg-deps.json index 822d29d9..72409dd8 100644 --- a/packages/pkg-deps.json +++ b/packages/pkg-deps.json @@ -34,9 +34,6 @@ "jsonschema" : { "3" : "python34-jsonschema" }, - "prettytable" : { - "3" : "python34-prettytable" - }, "pyflakes" : { "2" : "pyflakes", "3" : "python34-pyflakes" diff --git a/requirements.txt b/requirements.txt index 61d1e90b..dd10d85d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,9 +3,6 @@ # Used for untemplating any files or strings with parameters. jinja2 -# This is used for any pretty printing of tabular data. -PrettyTable - # This one is currently only used by the MAAS datasource. If that # datasource is removed, this is no longer needed oauthlib diff --git a/tools/build-on-freebsd b/tools/build-on-freebsd index ff9153ad..d23fde2b 100755 --- a/tools/build-on-freebsd +++ b/tools/build-on-freebsd @@ -18,7 +18,6 @@ pkgs=" py27-jsonpatch py27-jsonpointer py27-oauthlib - py27-prettytable py27-requests py27-serial py27-six @@ -64,7 +64,6 @@ deps = # requirements jinja2==2.8 pyyaml==3.11 - PrettyTable==0.7.2 oauthlib==1.0.3 pyserial==3.0.1 configobj==5.0.6 @@ -89,7 +88,6 @@ deps = argparse==1.2.1 jinja2==2.2.1 pyyaml==3.10 - PrettyTable==0.7.2 oauthlib==0.6.0 configobj==4.6.0 requests==2.6.0 @@ -105,7 +103,6 @@ deps = argparse==1.3.0 jinja2==2.8 PyYAML==3.11 - PrettyTable==0.7.2 oauthlib==0.7.2 configobj==5.0.6 requests==2.11.1 |