From 19f8ee172963ec5ced6030a312050d98d99e4382 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson <alexander.olofsson@liu.se> Date: Mon, 10 Aug 2020 09:52:02 +0200 Subject: [PATCH] Only show enabled images for selection --- app/views/wds_servers/_image_select.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/wds_servers/_image_select.html.erb b/app/views/wds_servers/_image_select.html.erb index 8ec768b..c4e23ba 100644 --- a/app/views/wds_servers/_image_select.html.erb +++ b/app/views/wds_servers/_image_select.html.erb @@ -3,7 +3,7 @@ host = @host || f.object.host server = host.public_send(:wds_server) rescue nil images = server.all_images rescue [] - images = images.select { |img| img.matches_architecture? host.architecture } if host.architecture + images = images.select { |img| img.matches_architecture?(host.architecture) && img.enabled } if host.architecture boot_images = images.select { |img| img.is_a?(ForemanWds::WdsBootImage) } install_images = images.select { |img| img.is_a?(ForemanWds::WdsInstallImage) } install_images = install_images.select { |img| img.version == "#{host.operatingsystem.major}.#{host.operatingsystem.minor}" } if host.operatingsystem -- GitLab