Skip to content

Commit

Permalink
Ensure Zone data is Valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Cheal committed Aug 22, 2018
1 parent 45aa7a5 commit 83d8b2c
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 83d8b2c

Please sign in to comment.