@@ -0,0 +1,1466 @@
+#!/usr/bin/python%0Aimport ConfigParser%0Aimport pprint%0A%0Adef get_external_idps(director_configfile):%0A    %22%22%22%0A%09get_external_idps(director_configfile)%0A%09Checks in the conpaas section if the support_external_idp option is present and set.%0A%09If so, checks if external_idps option is present, and for all %0A%09named idps collects all the options in the respective idp sections.%0A%09Validation of option names and values n the idp sections is left to the calling program.%0A%09Returns a dictonary with all idps and their options.%0A    %22%22%22%0A    dict1 = %7B%7D%0A    Config = ConfigParser.ConfigParser()%0A    result = Config.read(director_configfile)%0A    if result == %5B%5D:%0A        print 'Could not read %25s' %25 filename%0A    idp_support = False # easy init%0A    external_idps = %5B%5D # easy init%0A    try:%0A%09idp_support = Config.getboolean('conpaas', 'support_external_idp')%0A%09if idp_support:%0A%09    external_idps = Config.get('conpaas', 'external_idps').split(',')%0A    except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) as e:%0A%09print e%0A    if not idp_support:%0A        return dict1%0A    for xi in external_idps:%0A%09options = %5B%5D # easy init%0A%09try:%0A%09    options = Config.options(xi)%0A%09except ConfigParser.NoSectionError as e:%0A%09    print e%0A%09    continue # next xi%0A%09dict2 = %7B%7D%0A%09for option in options:%0A%09    dict2%5Boption%5D = Config.get(xi, option)%0A        dict1%5Bxi%5D = dict2%0A    return dict1%0A%0Aif __name__ == '__main__':%0A    ei_dict = get_external_idps(%22/etc/cpsdirector/director.cfg%22)%0A    pprint.pprint(ei_dict)%0A

Add code to support OpenID