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

Fix save_inventory error if lan can't be found #18433

Conversation

agrare
Copy link
Member

@agrare agrare commented Feb 5, 2019

When loading IDs of newly saved lans skip any that can't be found by uid_ems. This is still indicative of another issue but this should at least allow refresh to continue.

NoMethodError: undefined method `id' for nil:NilClass]. Skipping Host.
[----] E, [2018-11-20T03:53:53.054427 #66702:e15118] ERROR -- : [NoMethodError]: undefined method `id' for nil:NilClass  Method:[block in method_missing]
[----] E, [2018-11-20T03:53:53.054663 #66702:e15118] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:324:in `block (2 levels) in save_switches_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:322:in `each' 
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:322:in `block in save_switches_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:317:in `each' 
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:317:in `save_switches_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:122:in `block in save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:122:in `each' 
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:122:in `save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:183:in `block in save_hosts_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:132:in `each' 
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:132:in `save_hosts_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:122:in `block in save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:122:in `each' 
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:122:in `save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_infra.rb:69:in `save_ems_infra_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:12:in `save_ems_inventory'
/opt/rh/cfme-gemset/bundler/gems/cfme-providers-vmware-7f32eae469a5/app/models/manageiq/providers/vmware/infra_manager/refresher.rb:62:in `block in save_inventory

https://bugzilla.redhat.com/show_bug.cgi?id=1657341

When loading IDs of newly saved lans skip any that can't be found by
uid_ems.

https://bugzilla.redhat.com/show_bug.cgi?id=1657341
Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@gtanzillo gtanzillo added this to the Sprint 105 Ending Feb 18, 2019 milestone Feb 5, 2019
@gtanzillo gtanzillo merged commit 6f5a1b0 into ManageIQ:master Feb 5, 2019
@agrare agrare deleted the bz_1657341_fix_save_switches_inventory_lan_fails_to_save branch February 5, 2019 20:57
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