From 29dd7555c9b10acb507631fe296740228bd3e2c4 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 17 Mar 2023 15:34:15 -0400 Subject: [PATCH] ems_id cannot be an array, simplifying this logic ems_id comes from ems_id_from_queue_name which as of [1] can only ever return an integer or nil from parse_ems_id. [1] https://github.com/ManageIQ/manageiq/pull/20345 --- app/models/miq_worker/container_common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/miq_worker/container_common.rb b/app/models/miq_worker/container_common.rb index 69016bd45560..ca9203b683c2 100644 --- a/app/models/miq_worker/container_common.rb +++ b/app/models/miq_worker/container_common.rb @@ -108,7 +108,7 @@ def deployment_prefix def worker_deployment_name @worker_deployment_name ||= begin deployment_name = abbreviated_class_name.dup.chomp("Worker").sub("Manager", "").sub(/^Miq/, "") - deployment_name << "-#{Array(ems_id).map { |id| ApplicationRecord.split_id(id).last }.join("-")}" if respond_to?(:ems_id) && ems_id.present? + deployment_name << "-#{ApplicationRecord.split_id(ems_id).last}" if respond_to?(:ems_id) && ems_id.kind_of?(Fixnum) "#{deployment_prefix}#{deployment_name.underscore.dasherize.tr("/", "-")}" end end