Commit fac6f962 authored by Lorenz Steinert's avatar Lorenz Steinert

removed some indention errors and fixed get_protokollant_ldap

parent cd07fe93
......@@ -69,13 +69,11 @@ class FsrLdap:
"""search the LDAP for the current user"""
logging.info("Fetching Protokollant from LDAP ...")
try:
conn = ldap.Connection(self.server)
conn.bind()
fil = "(uid="+current_user()+")"
if conn.search('ou=people,' + self.base, fil,
attributes=['displayName']):
if self.conn.search('ou=people,' + self.base, fil,
attributes=['displayName']):
logging.info("Done")
return " ".join(str(conn.entries[0]['displayName']).split(", ")[::-1])
return " ".join(str(self.conn.entries[0]['displayName']).split(", ")[::-1])
return get_protokollant(config)
except ldap.core.exceptions.LDAPException as error_message:
if self.debug:
......@@ -262,8 +260,8 @@ def get_config(rundir, config_path=None, default=False):
config.read(os.path.join(rundir, '../etc/proto.ini.default'))
return config
logging.warning('No default File found at '
+ os.path.abspath(os.path.join(rundir,
'../etc/proto.ini.default')))
+ os.path.abspath(os.path.join(rundir,
'../etc/proto.ini.default')))
sys.exit(1)
elif os.path.isfile(os.path.join(rundir,
'../etc/proto.ini')) and not default:
......@@ -294,7 +292,7 @@ def get_share(rundir, config=None, sharedir=None):
elif os.path.isdir(os.path.join(rundir, '../share')):
return os.path.join(rundir, '../share')
logging.warning('No share Directory found at '
+ os.path.abspath(os.path.join(rundir, '../share')))
+ os.path.abspath(os.path.join(rundir, '../share')))
sys.exit(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment