def symptom_LDAP_file_based_domain_specific_configs_formatted_correctly():
 filedir = CONF.identity.domain_config_dir
 if ((not CONF.identity.domain_specific_drivers_enabled) or CONF.identity.domain_configurations_from_database or (not os.path.isdir(filedir))):
  return False
 invalid_files = []
 for filename in os.listdir(filedir):
  if re.match(CONFIG_REGEX, filename):
   try:
    parser = configparser.ConfigParser()
    parser.read(os.path.join(filedir, filename))
   except configparser.Error:
    invalid_files.append(filename)
 if invalid_files:
  invalid_str = ', '.join(invalid_files)
  print('Error: The following config files are formatted incorrectly: ', invalid_str)
  return True
 return False

def symptom_LDAP_file_based_domain_specific_configs_formatted_correctly ( ) : filedir = CONF . identity . domain_config_dir if ( ( not CONF . identity . domain_specific_drivers_enabled ) or CONF . identity . domain_configurations_from_database or ( not os . path . isdir ( filedir ) ) ) : return False invalid_files = [ ] for filename in os . listdir ( filedir ) : if re . match ( CONFIG_REGEX , filename ) : try : parser = configparser . ConfigParser ( ) parser . read ( os . path . join ( filedir , filename ) ) except configparser . Error : invalid_files . append ( filename ) if invalid_files : invalid_str = ', ' . join ( invalid_files ) print ( 'Error: The following config files are formatted incorrectly: ' , invalid_str ) return True return False
ldap domain specific configuration files are not formatted correctly .