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

adding loading of the roles yaml file

This commit is contained in:
kakwa 2015-05-12 01:24:16 +02:00
parent 6ece24bd84
commit e9ff75061d
4 changed files with 94 additions and 8 deletions

View file

@ -8,19 +8,20 @@
import os
import sys
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
from ldapcherry.pyyamlwrapper import loadNoDump
class Roles:
def __init__(self, role_file):
pass
stream = open(role_file, 'r')
self.roles_raw = loadNoDump(stream)
stream.close()
self._nest()
def _nest(self, role_file):
def _nest(self):
"""nests the roles (creates roles hierarchy)"""
pass
self.roles = self.roles_raw
def write(self, out_file):
"""write the nested role hierarchy to a file"""