1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-06-07 19:47:47 +02:00
ldapcherry/ldapcherry/exceptions.py

35 lines
1.1 KiB
Python
Raw Normal View History

2015-04-15 21:13:14 +02:00
# -*- coding: utf-8 -*-
# vim:set expandtab tabstop=4 shiftwidth=4:
#
# The MIT License (MIT)
# LdapCherry
# Copyright (c) 2014 Carpentier Pierre-Francois
2015-04-15 23:10:01 +02:00
class MissingParameter(Exception):
def __init__(self, section, key):
self.section = section
self.key = key
self.log = "missing parameter <%(key)s> in section <%(section)s>" % { 'key' : key, 'section' : section }
2015-05-12 01:24:16 +02:00
class MissingKey(Exception):
def __init__(self, key):
self.key = key
class DumplicateRoleKey(Exception):
def __init__(self, role):
self.role = role
self.log = "duplicate role key <%(role)s> in role file" % { 'role' : role}
2015-05-12 01:24:16 +02:00
class DumplicateRoleContent(Exception):
def __init__(self, role1, role2):
self.role1 = role1
self.role2 = role2
self.log = "role <%(role1)s> and <%(role2)s> are identical" % { 'role1' : role1, 'role2': role2}
class MissingRolesFile(Exception):
def __init__(self, rolefile):
self.rolefile = rolefile
self.log = "fail to open role file <%(rolefile)s>" % { 'rolefile' : rolefile}