mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 01:14:21 +01:00
handling exception if a role key is duplicated
This commit is contained in:
parent
89e8e2aac0
commit
4aac712286
@ -9,13 +9,18 @@ import os
|
||||
import sys
|
||||
|
||||
from ldapcherry.pyyamlwrapper import loadNoDump
|
||||
from ldapcherry.pyyamlwrapper import DumplicatedKey
|
||||
from ldapcherry.exceptions import DumplicateRoleKey, MissingKey, DumplicateRoleContent
|
||||
|
||||
|
||||
class Roles:
|
||||
|
||||
def __init__(self, role_file):
|
||||
stream = open(role_file, 'r')
|
||||
self.roles_raw = loadNoDump(stream)
|
||||
try:
|
||||
self.roles_raw = loadNoDump(stream)
|
||||
except DumplicatedKey as e:
|
||||
raise DumplicateRoleKey(e.key)
|
||||
stream.close()
|
||||
self._nest()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user