Skip to content

Commit

Permalink
ems_id cannot be an array, simplifying this logic
Browse files Browse the repository at this point in the history
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] ManageIQ#20345
  • Loading branch information
jrafanie committed Mar 17, 2023
1 parent c77ea58 commit f0715d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_worker/container_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0715d8

Please sign in to comment.