Skip to content

Commit f63a3c2

Browse files
A-Beckitewk
authored andcommitted
Update template dialog element (#137)
+ Gaurd against case where nothing is selected + Drop down returns "[]" + Gaurd against case where a tag has not been created + This case is unlikely based on dialog element that is feeding it + Including defensive check in case new "nothing selected" return value is introduced
1 parent 2dbaab5 commit f63a3c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Automate/RedHatConsulting_Utilities/Service/Provisioning/DynamicDialogs.class/__methods__/get_templates_based_on_selected_os_and_location.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def error(msg)
6464

6565
# invalid if no location tags selected
6666
location_tags.delete("null")
67+
location_tags.delete("[]")
6768
if location_tags.empty?
6869
invalid_selection = true
6970
value << "Destination location(s) must be selected to determine valid destination providers."
@@ -80,7 +81,8 @@ def error(msg)
8081
tag = $evm.vmdb(:classification).find_by_name(provider_tag_name)
8182
$evm.log(:info, "provider_tag_name => '#{provider_tag_name}', tag => #{tag}") if @DEBUG
8283
invalid_selection = true
83-
value << "Could not find Provider with Tag <#{tag.parent.description}: #{tag.description}>"
84+
value << "Could not find Provider with Tag <#{tag.parent.description}: #{tag.description}>" unless tag.blank?
85+
value << "Invalid location Tag provided: <#{provider_tag_name}>" if tag.blank?
8486
else
8587
providers_by_tag[provider_tag_name] = tagged_providers
8688
end

0 commit comments

Comments
 (0)