]> git.e2factory.org Git - e2factory.git/commitdiff
e2lib: improve verification of e2.conf some more
authorTobias Ulmer <tu@emlix.com>
Mon, 18 Mar 2019 19:51:49 +0000 (20:51 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 18 Mar 2019 19:52:05 +0000 (20:52 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index 91cbf75c5eb15a537a41f10aa1f2de874fddc855..d7ab5ad9618fbff7f66098ad26626671e92faaf2 100644 (file)
@@ -1049,7 +1049,14 @@ local function verify_global_config(config)
             end
             e2lib.globals.logrotate = config.log.logrotate
         end
+
+        rc, re = e2lib.vrfy_dict_exp_keys(config.log, "e2 config.log",
+            { "logrotate", })
+        if not rc then
+            return false, re
+        end
     end
+
     rc, re = assert_type(config.site, "config.site", "table")
     if not rc then
         return false, re
@@ -1075,11 +1082,23 @@ local function verify_global_config(config)
         return false, re
     end
 
+    rc, re = assert_type(config.site.e2_location, "config.site.e2_location", "string")
+    if not rc then
+        return false, re
+    end
+
     rc, re = assert_type(config.site.default_extensions, "config.site.default_extensions", "table")
     if not rc then
         return false, re
     end
 
+    rc, re = e2lib.vrfy_dict_exp_keys(config.site, "e2 config.site",
+        { "e2_branch", "e2_tag", "e2_server", "e2_base", "e2_location",
+          "default_extensions" })
+    if not rc then
+        return false, re
+    end
+
     rc, re = assert_type(config.servers, "config.servers", "table")
     if not rc then
         return false, re
@@ -1090,6 +1109,11 @@ local function verify_global_config(config)
         return false, re
     end
 
+    rc, re = e2lib.vrfy_dict_exp_keys(config.cache, "e2 config.cache", { "path", })
+    if not rc then
+        return false, re
+    end
+
     rc, re = e2lib.vrfy_dict_exp_keys(config, "e2 config",
         { "cache", "log", "servers", "site", "tools", })
     if not rc then