Use self.log in authpam.py
authorSimo Sorce <simo@redhat.com>
Fri, 24 Oct 2014 22:01:04 +0000 (18:01 -0400)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Mon, 27 Oct 2014 13:58:27 +0000 (14:58 +0100)
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/login/authpam.py

index fca44ba..35edbaf 100755 (executable)
@@ -20,7 +20,6 @@
 from ipsilon.login.common import LoginFormBase, LoginManagerBase
 from ipsilon.login.common import FACILITY
 from ipsilon.util.plugin import PluginObject
-import cherrypy
 import pam
 import subprocess
 
@@ -34,10 +33,10 @@ class Pam(LoginFormBase):
             ok = pam.authenticate(username, password)
 
         if ok:
-            cherrypy.log("User %s successfully authenticated." % username)
+            self.log("User %s successfully authenticated." % username)
             return username
 
-        cherrypy.log("User %s failed authentication." % username)
+        self.log("User %s failed authentication." % username)
         return None
 
     def POST(self, *args, **kwargs):
@@ -52,10 +51,10 @@ class Pam(LoginFormBase):
                 return self.lm.auth_successful(self.trans, user, 'password')
             else:
                 error = "Authentication failed"
-                cherrypy.log.error(error)
+                self.error(error)
         else:
             error = "Username or password is missing"
-            cherrypy.log.error("Error: " + error)
+            self.error("Error: " + error)
 
         context = self.create_tmpl_context(
             username=username,