From 57f7d2b987dd3ccb7be489f1196c4335406a6dfa Mon Sep 17 00:00:00 2001 From: Alexander Olofsson <alexander.olofsson@liu.se> Date: Fri, 20 Jan 2023 11:06:03 +0100 Subject: [PATCH] Fix naming for facets search --- .../concerns/host_finder_extensions.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/foreman/unattended_installation/concerns/host_finder_extensions.rb b/app/services/foreman/unattended_installation/concerns/host_finder_extensions.rb index 01a3193..4abd439 100644 --- a/app/services/foreman/unattended_installation/concerns/host_finder_extensions.rb +++ b/app/services/foreman/unattended_installation/concerns/host_finder_extensions.rb @@ -13,11 +13,11 @@ module HostFinderExtensions def find_host_by_uuid return unless (uuid = query_params['uuid']) - facet = ForemanUuidBoot::UuidbootHostFacet.where(uuid: uuid).order(:created_at) - if facet.any? - Rails.logger.warn("Multiple hosts found with #{uuid}, picking up the most recent") if facet.count > 1 + facets = ForemanUuidBoot::UuidbootHostFacet.where(uuid: uuid).order(:created_at) + if facets.any? + Rails.logger.warn("Multiple hosts found with #{uuid}, picking up the most recent") if facets.count > 1 - return facet.last.host.reload + return facets.last.host.reload end # Fallback fact search -- GitLab