From de28f3659a10a4ee7372e76d2b58f6c69b084919 Mon Sep 17 00:00:00 2001 From: Douglas Gabriel Date: Fri, 16 Mar 2018 09:24:49 -0300 Subject: [PATCH] leaving the disk capacity blank if the LXCA doesn't provide this information --- .../parsers/components/physical_server_parser.rb | 2 +- .../lenovo/physical_infra_manager/refresh_parser_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/components/physical_server_parser.rb b/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/components/physical_server_parser.rb index b803ef0e62..979c6af24b 100644 --- a/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/components/physical_server_parser.rb +++ b/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/components/physical_server_parser.rb @@ -57,7 +57,7 @@ def get_disk_capacity(node) total_disk_cap += disk['capacity'] unless disk['capacity'].nil? end end - total_disk_cap + total_disk_cap > 0 ? total_disk_cap : nil end def get_memory_info(node) diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb index fc4e4efb41..64da9e4f29 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb @@ -86,7 +86,7 @@ computer_system = physical_server[:computer_system] hardware = computer_system[:hardware] - expect(hardware[:disk_capacity]).to eq(0) + expect(hardware[:disk_capacity]).to be_nil end end