Skip to content

Commit

Permalink
Merge pull request #17892 from juliancheal/fix_invalid_zone
Browse files Browse the repository at this point in the history
Ensure Zone data is Valid
(cherry picked from commit 2b06c5d)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1599349
  • Loading branch information
bdunne authored and simaishi committed Sep 11, 2018
1 parent 530c20d commit 1ee2efb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/vmdb/config/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ def server(data)
errors << [:session_store, "session_store, \"#{data.session_store}\", invalid. Should be one of \"sql\", \"memory\", \"cache\""]
end

if keys.include?(:zone)
unless Zone.in_my_region.find_by(:name => data.zone)
valid = false
errors << [:zone, "zone, \"#{data.zone}\", invalid. Should be a vaild Zone"]
end
end

return valid, errors
end

Expand Down

0 comments on commit 1ee2efb

Please sign in to comment.