Esempio n. 1
0
 def __init__(self, name, modconfig):
     "Prepare LDAP settings"
     pyt_ldap.pyt_ldap.__init__(self, name, modconfig)
     keys = [item.lower() for item in self.modconfig['attrs'].split(',')]
     values = [item.lower() for item in self.modconfig['values'].split(',')]
     if len(keys) != len(values):
         raise Errors.ConfigurationError(
             "pkt_ldap_attributes: keys/values length mismatch")
     del self.modconfig['values']
     self.modconfig['attrs'] = dict(zip(keys, values))
     print "%s" % (self.modconfig['attrs'], )
Esempio n. 2
0
 def __init__(self, name, modconfig):
     "Prepare whatever is needed"
     self.modconfig = modconfig
     for key in self.__required__:
         if not self.modconfig.has_key(key):
             raise Errors.ConfigurationError(
                 "Required option '%s' missing [%s:%s]" % (
                     key,
                     name,
                     self.__class__.__name__.split('.')[-1],
                 ))