Commit c5f9d8a7 authored by Lorenz Steinert's avatar Lorenz Steinert

add error processing

parent 292f7caa
......@@ -319,6 +319,7 @@ def get_share(rundir, config=None, sharedir=None):
+ os.path.abspath(os.path.join(rundir, '../share')))
return Error.NO_DEFAULT_DIR
def get_path(rundir, config=None, path=None):
"""get the location of the protokoll directory"""
if path:
......@@ -159,8 +159,20 @@ if __name__ == "__main__":
RUNDIR = os.path.dirname(os.path.realpath(__file__))
OPT = build_parser()
CONFIG = get_config(RUNDIR, OPT.config)
if CONFIG is esme.Error.NO_FILE:
print("No config-file found. Stoping.")
elif CONFIG is esme.Error.NO_DEFAULT_FILE:
print("No default config-file found. Stopping.")
SHARE_DIR = get_share(RUNDIR, CONFIG, OPT.sharedir)
if SHARE_DIR is esme.Error.NO_DIR:
print("No sharedir found. Stopping.")
elif SHARE_DIR is esme.Error.NO_DEFAULT_DIR:
print("No default sharedir found. Stopping.")
LDAP_SERVER = get_ldap_server(CONFIG, OPT.Server)
LDAP_SERVER_BASE = get_ldap_base(CONFIG, OPT.base)
SERVER_TIMEOUT = get_server_timeout(CONFIG, OPT.test)
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