summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Reports/backends.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-04-04 13:15:14 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-04-06 19:35:21 -0500
commitf124f7f6ee5dc8710ba354e0e978a82245c11fbf (patch)
treeb9c39fa7b1350f58da01a0e06093c38b1a04a99b /src/lib/Server/Reports/backends.py
parent8f4a2394638912b000682e2211723e4a644915e1 (diff)
downloadbcfg2-f124f7f6ee5dc8710ba354e0e978a82245c11fbf.tar.gz
bcfg2-f124f7f6ee5dc8710ba354e0e978a82245c11fbf.tar.bz2
bcfg2-f124f7f6ee5dc8710ba354e0e978a82245c11fbf.zip
Reports: PY3K + PEP8 fixes
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server/Reports/backends.py')
-rw-r--r--src/lib/Server/Reports/backends.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/lib/Server/Reports/backends.py b/src/lib/Server/Reports/backends.py
index 9207038ed..9e37a2e6f 100644
--- a/src/lib/Server/Reports/backends.py
+++ b/src/lib/Server/Reports/backends.py
@@ -1,35 +1,32 @@
from django.contrib.auth.models import User
from nisauth import *
+
class NISBackend(object):
def authenticate(self, username=None, password=None):
try:
- print "start nis authenticate"
+ print("start nis authenticate")
n = nisauth(username, password)
temp_pass = User.objects.make_random_password(100)
nis_user = dict(username=username,
)
- user_session_obj = dict(
- email = username,
- first_name = None,
- last_name = None,
- uid = n.uid
- )
+ user_session_obj = dict(email=username,
+ first_name=None,
+ last_name=None,
+ uid=n.uid)
user, created = User.objects.get_or_create(username=username)
-
+
return user
except NISAUTHError, e:
- print str(e)
+ print(str(e))
return None
-
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist, e:
- print str(e)
+ print(str(e))
return None
-