2015-05-17 12:24:29 +02:00
|
|
|
from ldapcherry.attributes import Attributes
|
|
|
|
from ldapcherry.exceptions import DumplicateRoleKey, MissingKey, DumplicateRoleContent, MissingRolesFile
|
|
|
|
from ldapcherry.pyyamlwrapper import DumplicatedKey, RelationError
|
|
|
|
from yaml import load, dump
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
try:
|
|
|
|
from yaml import CLoader as Loader, CDumper as Dumper
|
|
|
|
except ImportError:
|
|
|
|
from yaml import Loader, Dumper
|
|
|
|
|
|
|
|
class CustomDumper(yaml.SafeDumper):
|
|
|
|
"A custom YAML dumper that never emits aliases"
|
|
|
|
|
|
|
|
def ignore_aliases(self, _data):
|
|
|
|
return True
|
|
|
|
|
2015-05-18 12:30:51 +02:00
|
|
|
try:
|
2015-06-16 08:57:44 +02:00
|
|
|
inv = Attributes('./tests/cfg/attributes.yml')
|
|
|
|
#inv = Attributes('./tests/cfg/attributes_wrong_type.yml')
|
2015-05-18 12:30:51 +02:00
|
|
|
except Exception as e:
|
|
|
|
print e.log
|
2015-06-16 08:57:44 +02:00
|
|
|
|
|
|
|
print inv.backend_attributes
|