Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle a HostSystem with missing product vendor #882

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

agrare
Copy link
Member

@agrare agrare commented Sep 18, 2023

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'

Handle the case where a HostSystem is missing
`summary.config.product.vendor`
@miq-bot
Copy link
Member

miq-bot commented Sep 18, 2023

Checked commit agrare@40e9e19 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. 👍

@Fryguy Fryguy merged commit 3bdb9cd into ManageIQ:master Sep 18, 2023
4 checks passed
@Fryguy Fryguy self-assigned this Sep 18, 2023
@agrare agrare deleted the fix_host_parser_no_vendor branch September 18, 2023 19:28
@Fryguy
Copy link
Member

Fryguy commented Sep 27, 2023

Backported to quinteros in commit 5829a26.

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)

Fryguy added a commit that referenced this pull request Sep 27, 2023
Handle a HostSystem with missing product vendor

(cherry picked from commit 3bdb9cd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants