From 64bffc3fe8ca6a01df03c9395ebd9a495836c2cb Mon Sep 17 00:00:00 2001 From: Cameron Porter Date: Tue, 31 Dec 2019 11:48:54 -0600 Subject: [PATCH] Fix issue where the summary command fails due to None being provided as the datacenter name. --- SoftLayer/CLI/core.py | 2 +- SoftLayer/CLI/summary.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SoftLayer/CLI/core.py b/SoftLayer/CLI/core.py index f34e0c4f9..3a552df79 100644 --- a/SoftLayer/CLI/core.py +++ b/SoftLayer/CLI/core.py @@ -115,7 +115,7 @@ def cli(env, **kwargs): """Main click CLI entry-point.""" - # Populate environement with client and set it as the context object + # Populate environment with client and set it as the context object env.skip_confirmations = really env.config_file = config env.format = format diff --git a/SoftLayer/CLI/summary.py b/SoftLayer/CLI/summary.py index 6a17a71cf..7b9844de2 100644 --- a/SoftLayer/CLI/summary.py +++ b/SoftLayer/CLI/summary.py @@ -33,12 +33,12 @@ def cli(env, sortby): for name, datacenter in datacenters.items(): table.add_row([ - name, - datacenter['hardware_count'], - datacenter['virtual_guest_count'], - datacenter['vlan_count'], - datacenter['subnet_count'], - datacenter['public_ip_count'], + name or formatting.blank(), + datacenter.get('hardware_count', formatting.blank()), + datacenter.get('virtual_guest_count', formatting.blank()), + datacenter.get('vlan_count', formatting.blank()), + datacenter.get('subnet_count', formatting.blank()), + datacenter.get('public_ip_count', formatting.blank()), ]) env.fout(table)