From 8fac1571155e9e62e3f6f4fdbe0d5200aa353fc6 Mon Sep 17 00:00:00 2001 From: Jan Kessler Date: Wed, 4 Dec 2024 10:53:30 +0100 Subject: [PATCH] allow 'none' as a special tag to explicitly reference untagged servers --- app/models/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/server.rb b/app/models/server.rb index 31a9adbe..fbcfbe24 100644 --- a/app/models/server.rb +++ b/app/models/server.rb @@ -305,7 +305,7 @@ def self.find_available(tags_arg = nil) unless tags.nil? ids_loads_tagged = [] tags.each do |tag| - ids_loads_tagged.concat ids_loads.select { |myid, _| redis.hget(key(myid), 'tag') == tag } + ids_loads_tagged.concat ids_loads.select { |myid, _| (redis.hget(key(myid), 'tag') || "none") == tag } end ids_loads_tagged.sort_by! { |id_load| id_load[1] } end