ManageIQ / manageiq-providers-ibm_cic

Apache License 2.0
1 stars 11 forks source link

Fix missing cinder_manager caused by association :class_name #7

Closed agrare closed 2 years ago

agrare commented 2 years ago

The :class_name on the :cinder_manager association defined by the parent Openstack::CloudManager class was causing the IbmCic cinder manager to not be found.

This meant that even though a CinderManager record was created, manager.cinder_manager returned nil

https://github.com/ManageIQ/manageiq-providers-openstack/blob/master/app/models/manageiq/providers/openstack/cinder_manager_mixin.rb#L9

agrare commented 2 years ago

Since cloud_volumes are delegated from the CloudManager to the CinderManager this would cause targeted refreshes to fail here: https://github.com/ManageIQ/manageiq-providers-openstack/blob/master/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb#L339

Q-task_id([r1_miq_provision_1]) [NoMethodError]: undefined method `where' for nil:NilClass
Did you mean?  when  Method:[block (2 levels) in <class:LogProxy>]
Q-task_id([r1_miq_provision_1]) /opt/IBM/infrastructure-management-gemset/bundler/gems/bluecf-providers-openstack-e1b99d6856ef/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb:339:in `infer_related_cloud_volumes_ems_refs_db!'
/opt/IBM/infrastructure-management-gemset/bundler/gems/bluecf-providers-openstack-e1b99d6856ef/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb:295:in `infer_related_ems_refs!'
/opt/IBM/infrastructure-management-gemset/bundler/gems/bluecf-providers-openstack-e1b99d6856ef/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb:8:in `initialize'
/var/www/miq/vmdb/app/models/manageiq/providers/inventory.rb:11:in `new'
/var/www/miq/vmdb/app/models/manageiq/providers/inventory.rb:11:in `build'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:116:in `block in collect_inventory_for_targets'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:115:in `map'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:115:in `collect_inventory_for_targets'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:87:in `block in refresh_targets_for_ems'
Fryguy commented 2 years ago

Backported to najdorf in commit 39f3e1e7e5cffa8981b34b83aaab8baa22689c23.

commit 39f3e1e7e5cffa8981b34b83aaab8baa22689c23
Author: Jason Frey <fryguy9@gmail.com>
Date:   Thu Feb 17 16:50:17 2022 -0500

    Merge pull request #7 from agrare/fix_missing_cinder_manager

    Fix missing cinder_manager caused by association :class_name

    (cherry picked from commit 9ebfa8bb7ee7c9afcdd5c35044f9f92d19d801fd)