Implement change registration
[cascardo/ipsilon.git] / ipsilon / login / authfas.py
index 4ae0dc4..d0b834a 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright (C) 2014 Ipsilon contributors, see COPYING file for license
-
+# Copyright (C) 2014 Ipsilon project Contributors, for license see COPYING
 
 from ipsilon.login.common import LoginFormBase, LoginManagerBase, \
     LoginManagerInstaller
@@ -7,6 +6,7 @@ from ipsilon.util.plugin import PluginObject
 from ipsilon.util.policy import Policy
 from ipsilon.util import config as pconfig
 import cherrypy
+import logging
 
 from fedora.client.fasproxy import FasProxyClient
 from fedora.client import AuthError
@@ -54,9 +54,12 @@ class FAS(LoginFormBase):
             try:
                 _, data = self.lm.fpc.login(username, password)
             except AuthError, e:
-                cherrypy.log.error("Authentication error [%s]" % str(e))
+                cherrypy.log.error("Authentication error [%s]" % str(e),
+                                   severity=logging.ERROR)
             except Exception, e:  # pylint: disable=broad-except
-                cherrypy.log.error("Unknown Error [%s]" % str(e))
+                cherrypy.log.error("Unknown Error [%s]" % str(e),
+                                   severity=logging.ERROR)
+
             if data and data.user:
                 userdata = self.make_userdata(data.user)
                 return self.lm.auth_successful(self.trans,
@@ -64,10 +67,10 @@ class FAS(LoginFormBase):
                                                userdata=userdata)
             else:
                 error = "Authentication failed"
-                cherrypy.log.error(error)
+                cherrypy.log.error(error, severity=logging.ERROR)
         else:
             error = "Username or password is missing"
-            cherrypy.log.error("Error: " + error)
+            cherrypy.log.error("Error: " + error, severity=logging.ERROR)
 
         context = self.create_tmpl_context(
             username=username,
@@ -76,7 +79,6 @@ class FAS(LoginFormBase):
             error_username=not username
         )
         self.lm.set_auth_error()
-        # pylint: disable=star-args
         return self._template(self.formtemplate, **context)
 
     def make_userdata(self, fas_data):
@@ -183,7 +185,7 @@ class Installer(LoginManagerInstaller):
         group.add_argument('--fas', choices=['yes', 'no'], default='no',
                            help='Configure FAS authentication')
 
-    def configure(self, opts):
+    def configure(self, opts, changes):
         if opts['fas'] != 'yes':
             return