From c21ed37687dc186e9f9f61e7f5354ccaf3e5cba5 Mon Sep 17 00:00:00 2001 From: Shimon Shtein Date: Wed, 4 Oct 2023 14:09:35 +0300 Subject: [PATCH] Fix host deletion task call (#843) --- lib/inventory_sync/async/inventory_scheduled_sync.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/inventory_sync/async/inventory_scheduled_sync.rb b/lib/inventory_sync/async/inventory_scheduled_sync.rb index 55e8c5ec..f0c25d86 100644 --- a/lib/inventory_sync/async/inventory_scheduled_sync.rb +++ b/lib/inventory_sync/async/inventory_scheduled_sync.rb @@ -19,7 +19,7 @@ def plan Organization.unscoped.each do |org| sequence do plan_org_sync(org) - plan_remove_insights_hosts(org) if Setting[:allow_auto_insights_mismatch_delete] + plan_remove_insights_hosts(org.id) if Setting[:allow_auto_insights_mismatch_delete] end end end @@ -30,9 +30,9 @@ def plan_org_sync(org) plan_action InventoryFullSync, org end - def plan_remove_insights_hosts + def plan_remove_insights_hosts(org_id) # plan a remove hosts action with search set to empty (all records) - plan_action(ForemanInventoryUpload::Async::RemoveInsightsHostsJob, '', org.id) + plan_action(ForemanInventoryUpload::Async::RemoveInsightsHostsJob, '', org_id) end def logger