From c6e88e56cf8d1a986f05dc356d8074de84053fa3 Mon Sep 17 00:00:00 2001 From: Gregor Berginc Date: Thu, 26 Jan 2017 21:46:48 +0100 Subject: [PATCH] Queue EBS storage refresh after cloud inventory is saved While parsing volumes immediately after new AWS manager is created, EBS manager failed to get proper links to availability zones, because it was parsing data in parallel to the cloud manager. This patch queues the EBS storage manager parse in the same way as the network manager, i.e. immediately after the cloud inventory is saved, EBS refreshes the data once more. Signed-off-by: Gregor Berginc --- app/models/manageiq/providers/amazon/cloud_manager/refresher.rb | 1 + .../manageiq/providers/amazon/aws_refresher_spec_common.rb | 2 +- .../amazon/cloud_manager/refresher_other_region_spec.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/manageiq/providers/amazon/cloud_manager/refresher.rb b/app/models/manageiq/providers/amazon/cloud_manager/refresher.rb index 2ce5b9edd..83385c057 100644 --- a/app/models/manageiq/providers/amazon/cloud_manager/refresher.rb +++ b/app/models/manageiq/providers/amazon/cloud_manager/refresher.rb @@ -40,6 +40,7 @@ def parse_targeted_inventory(ems, _target, inventory) def save_inventory(ems, target, inventory_collections) EmsRefresh.save_ems_inventory(ems, inventory_collections) EmsRefresh.queue_refresh(ems.network_manager) if target.kind_of?(ManageIQ::Providers::BaseManager) + EmsRefresh.queue_refresh(ems.ebs_storage_manager) if target.kind_of?(ManageIQ::Providers::BaseManager) end def post_process_refresh_classes diff --git a/spec/models/manageiq/providers/amazon/aws_refresher_spec_common.rb b/spec/models/manageiq/providers/amazon/aws_refresher_spec_common.rb index a3da94416..9347d3d64 100644 --- a/spec/models/manageiq/providers/amazon/aws_refresher_spec_common.rb +++ b/spec/models/manageiq/providers/amazon/aws_refresher_spec_common.rb @@ -39,7 +39,7 @@ def expected_table_counts :floating_ip => 12, :guest_device => 0, :hardware => 46, - :miq_queue => 49, + :miq_queue => 50, :miq_template => 20, :network => 14, :network_port => 32, diff --git a/spec/models/manageiq/providers/amazon/cloud_manager/refresher_other_region_spec.rb b/spec/models/manageiq/providers/amazon/cloud_manager/refresher_other_region_spec.rb index 9dee9b5a1..911fb4678 100644 --- a/spec/models/manageiq/providers/amazon/cloud_manager/refresher_other_region_spec.rb +++ b/spec/models/manageiq/providers/amazon/cloud_manager/refresher_other_region_spec.rb @@ -55,7 +55,7 @@ def assert_table_counts expect(SystemService.count).to eq(0) expect(Relationship.count).to eq(2) - expect(MiqQueue.count).to eq(6) + expect(MiqQueue.count).to eq(7) end def assert_ems