From 0cf752fdf91834d834646b8673bff530e6449256 Mon Sep 17 00:00:00 2001 From: Sergio Carlos Morales Angeles Date: Thu, 27 Jul 2017 11:55:11 -0500 Subject: [PATCH 1/2] Avoid blindly passing memory result to formatter --- SoftLayer/CLI/hardware/detail.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SoftLayer/CLI/hardware/detail.py b/SoftLayer/CLI/hardware/detail.py index 7bd445426..62ea37c9f 100644 --- a/SoftLayer/CLI/hardware/detail.py +++ b/SoftLayer/CLI/hardware/detail.py @@ -43,7 +43,8 @@ def cli(env, identifier, passwords, price): table.add_row(['datacenter', result['datacenter']['name'] or formatting.blank()]) table.add_row(['cores', result['processorPhysicalCoreAmount']]) - table.add_row(['memory', formatting.gb(result['memoryCapacity'])]) + memory = formatting.gb(result['memoryCapacity']) if result.get('memoryCapacity') else formatting.blank() + table.add_row(['memory', memory]) table.add_row(['public_ip', result['primaryIpAddress'] or formatting.blank()]) table.add_row(['private_ip', From 8a7dddfeb36e824865337b21576063bad3014afb Mon Sep 17 00:00:00 2001 From: Sergio Carlos Morales Angeles Date: Thu, 27 Jul 2017 12:01:33 -0500 Subject: [PATCH 2/2] Break line --- SoftLayer/CLI/hardware/detail.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SoftLayer/CLI/hardware/detail.py b/SoftLayer/CLI/hardware/detail.py index 62ea37c9f..ebfbbca05 100644 --- a/SoftLayer/CLI/hardware/detail.py +++ b/SoftLayer/CLI/hardware/detail.py @@ -43,7 +43,9 @@ def cli(env, identifier, passwords, price): table.add_row(['datacenter', result['datacenter']['name'] or formatting.blank()]) table.add_row(['cores', result['processorPhysicalCoreAmount']]) - memory = formatting.gb(result['memoryCapacity']) if result.get('memoryCapacity') else formatting.blank() + memory = (formatting.gb(result['memoryCapacity']) + if result.get('memoryCapacity') + else formatting.blank()) table.add_row(['memory', memory]) table.add_row(['public_ip', result['primaryIpAddress'] or formatting.blank()])