From 83d8b2c0955c06a019fe0b1a2d405593c9a065b6 Mon Sep 17 00:00:00 2001 From: Julian Cheal Date: Wed, 22 Aug 2018 17:07:59 +0100 Subject: [PATCH] Ensure Zone data is Valid Fixes BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1599349 --- lib/vmdb/config/validator.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/vmdb/config/validator.rb b/lib/vmdb/config/validator.rb index 1cfe178652e..99d381d0c35 100644 --- a/lib/vmdb/config/validator.rb +++ b/lib/vmdb/config/validator.rb @@ -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