'Add an object with the specified attributes at dn.'

def add_s(self, dn, modlist):

    if server_fail:
        raise ldap.SERVER_DOWN
    id_attr_in_modlist = False
    id_attr = self._dn_to_id_attr(dn)
    id_value = self._dn_to_id_value(dn)
    for (k, dummy_v) in modlist:
        if (k is None):
            raise TypeError(('must    be    string,    not    None.    modlist=%s' % modlist))
        if (k == id_attr):
            for val in dummy_v:
                if (common.utf8_decode(val) == id_value):
                    id_attr_in_modlist = True
    if (not id_attr_in_modlist):
        LOG.debug('id_attribute=%(attr)s    missing,    attributes=%(attrs)s', {'attr': id_attr, 'attrs': modlist})
        raise ldap.NAMING_VIOLATION
    key = self.key(dn)
    LOG.debug('add    item:    dn=%(dn)s,    attrs=%(attrs)s', {'dn': common.utf8_decode(dn), 'attrs': modlist})
    if (key in self.db):
        LOG.debug('add    item    failed:    dn=%s    is    already    in    store.', common.utf8_decode(dn))
        raise ldap.ALREADY_EXISTS(dn)
    self.db[key] = {k: _internal_attr(k, v) for (k, v) in modlist}
    self.db.sync()
