'Remaining init of the server configuration
:param stype: The type of Server ("idp"/"aa")'

def init_config(self, stype='idp'):

    if (stype == 'aa'):
        return
    dbspec = self.config.getattr('subject_data', 'idp')
    idb = None
    typ = ''
    if (not dbspec):
        idb = {}
    elif isinstance(dbspec, basestring):
        idb = shelve.open(dbspec, writeback=True)
    else:
        (typ, addr) = dbspec
        if (typ == 'shelve'):
            idb = shelve.open(addr, writeback=True)
        elif (typ == 'memcached'):
            import memcache
            idb = memcache.Client(addr)
        elif (typ == 'dict'):
            idb = {}
        elif (typ == 'mongodb'):
            from saml2.mongo_store import IdentMDB
            self.ident = IdentMDB(database=addr, collection='ident')
        elif (typ == 'identdb'):
            (mod, clas) = addr.rsplit('.', 1)
            mod = importlib.import_module(mod)
            self.ident = getattr(mod, clas)()
    if ((typ == 'mongodb') or (typ == 'identdb')):
        pass
    elif (idb is not None):
        self.ident = IdentDB(idb)
    elif dbspec:
        raise Exception(("Couldn't    open    identity    database:    %s" % (dbspec,)))
    try:
        _domain = self.config.getattr('domain', 'idp')
        if _domain:
            self.ident.domain = _domain
        self.ident.name_qualifier = self.config.entityid
        dbspec = self.config.getattr('edu_person_targeted_id', 'idp')
        if (not dbspec):
            pass
        else:
            typ = dbspec[0]
            addr = dbspec[1]
            secret = dbspec[2]
            if (typ == 'shelve'):
                self.eptid = EptidShelve(secret, addr)
            elif (typ == 'mongodb'):
                from saml2.mongo_store import EptidMDB
                self.eptid = EptidMDB(secret, database=addr, collection='eptid')
            else:
                self.eptid = Eptid(secret)
    except Exception:
        self.ident.close()
        raise
