Changeset

2945:ec7f9c8f2a5f

mod_checkcerts: Fixed luacheck warnings
author Michel Le Bihan <michel@lebihan.pl>
date Fri, 23 Mar 2018 21:55:32 +0100
parents 2944:37ec4c2f319a
children 2946:dfac28504e86
files mod_checkcerts/mod_checkcerts.lua
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_checkcerts/mod_checkcerts.lua	Thu Mar 22 16:16:07 2018 +0100
+++ b/mod_checkcerts/mod_checkcerts.lua	Fri Mar 23 21:55:32 2018 +0100
@@ -1,3 +1,4 @@
+local config = require "core.configmanager";
 local ssl = require"ssl";
 local datetime_parse = require"util.datetime".parse;
 local load_cert = ssl.loadcertificate;
@@ -45,20 +46,20 @@
 		ssl_config = config.get("*", "ssl");
 	end
 	if not ssl_config or not ssl_config.certificate then
-		log("warn", "Could not find a certificate to check");
+		module:log("warn", "Could not find a certificate to check");
 		return;
 	end
 
 	local certfile = ssl_config.certificate;
 	local fh, ferr = io.open(certfile); -- Load the file.
 	if not fh then
-		log("warn", "Could not open certificate %s", ferr);
+		module:log("warn", "Could not open certificate %s", ferr);
 		return;
 	end
 	local cert, lerr = load_cert(fh:read("*a")); -- And parse
 	fh:close();
 	if not cert then
-		log("warn", "Could not parse certificate %s: %s", certfile, lerr or "");
+		module:log("warn", "Could not parse certificate %s: %s", certfile, lerr or "");
 		return;
 	end