Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Zone data is Valid #17892

Merged
merged 1 commit into from Aug 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/vmdb/config/validator.rb
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