summaryrefslogtreecommitdiffstats
path: root/ipsilon/login/authfas.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2015-04-21 18:19:17 -0400
committerSimo Sorce <simo@redhat.com>2015-05-07 10:44:23 -0400
commitaa5dc3b417db962a075a092d0d3528010c1059f7 (patch)
treec1f91118444bdc0d26c8bd95c8683504227b99bb /ipsilon/login/authfas.py
parent1e2cb84b570cfaa5d2de9d5830a752100cac236c (diff)
downloadipsilon-aa5dc3b417db962a075a092d0d3528010c1059f7.tar.gz
ipsilon-aa5dc3b417db962a075a092d0d3528010c1059f7.tar.xz
ipsilon-aa5dc3b417db962a075a092d0d3528010c1059f7.zip
Use python logging in install / log cherrypy at right severity
This replaces the print statements in the installer code with a python logger so we can log all output to the installer log and a subset of it to stdout in one step without duplication. The cherrypy.log.error() logs to the "error" log at a severity of logging.INFO by default. Set an appropriate log level for these as well. https://fedorahosted.org/ipsilon/ticket/35 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'ipsilon/login/authfas.py')
-rw-r--r--ipsilon/login/authfas.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ipsilon/login/authfas.py b/ipsilon/login/authfas.py
index 4ae0dc4..1489f73 100644
--- a/ipsilon/login/authfas.py
+++ b/ipsilon/login/authfas.py
@@ -7,6 +7,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 +55,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 +68,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,