1
0
Fork 0
mirror of https://github.com/kakwa/ldapcherry synced 2025-07-04 12:27:47 +02:00

adding an exception for failures to open role file

This commit is contained in:
kakwa 2015-05-12 11:34:28 +02:00
parent 17b8aa6406
commit 804e2b7202
3 changed files with 25 additions and 3 deletions

View file

@ -10,13 +10,16 @@ import sys
from ldapcherry.pyyamlwrapper import loadNoDump
from ldapcherry.pyyamlwrapper import DumplicatedKey
from ldapcherry.exceptions import DumplicateRoleKey, MissingKey, DumplicateRoleContent
from ldapcherry.exceptions import DumplicateRoleKey, MissingKey, DumplicateRoleContent, MissingRolesFile
class Roles:
def __init__(self, role_file):
stream = open(role_file, 'r')
try:
stream = open(role_file, 'r')
except:
raise MissingRolesFile(role_file)
try:
self.roles_raw = loadNoDump(stream)
except DumplicatedKey as e: