ManageIQ / manageiq-providers-vmware

ManageIQ plugin for the VMware vSphere and vCloud providers.
Apache License 2.0
22 stars 70 forks source link

Handle a HostSystem with missing product vendor #882

Closed agrare closed 1 year ago

agrare commented 1 year ago

Handle the case where a HostSystem is missing summary.config.product.vendor. We already set the vmm_vendor to "unknown" if we do not recognize the vendor, but this will throw an exception if the attribute is completely missing:

     Failure/Error: vendor = product[:vendor].split(",").first.to_s.downcase

     NoMethodError:
       undefined method `split' for nil:NilClass
     # ./app/models/manageiq/providers/vmware/infra_manager/inventory/parser/host_system.rb:116:in `parse_host_system_product'
     # ./app/models/manageiq/providers/vmware/infra_manager/inventory/parser.rb:205:in `parse_host_system'
     # ./app/models/manageiq/providers/vmware/infra_manager/inventory/parser.rb:28:in `parse'
     # ./app/models/manageiq/providers/vmware/infra_manager/inventory/collector.rb:252:in `block in parse_updates'
     # ./app/models/manageiq/providers/vmware/infra_manager/inventory/collector.rb:242:in `each'
     # ./app/models/manageiq/providers/vmware/infra_manager/inventory/collector.rb:242:in `parse_updates'
miq-bot commented 1 year ago

Checked commit https://github.com/agrare/manageiq-providers-vmware/commit/40e9e19e2427bc9c398335aa8edab2629433b395 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :+1:

Fryguy commented 1 year ago

Backported to quinteros in commit 5829a26588fb37835e83112e3c73559c53b88e37.

commit 5829a26588fb37835e83112e3c73559c53b88e37
Author: Jason Frey <fryguy9@gmail.com>
Date:   Mon Sep 18 15:28:11 2023 -0400

    Merge pull request #882 from agrare/fix_host_parser_no_vendor

    Handle a HostSystem with missing product vendor

    (cherry picked from commit 3bdb9cd706e5cc678bf760d3dcb6f6fe0d94911a)