@requires_rw<EOL><INDENT>def edit_pool(self, auth, spec, attr):<DEDENT>
self._logger.debug("<STR_LIT>" %<EOL>(unicode(spec), unicode(attr)))<EOL>if ('<STR_LIT:id>' not in spec and '<STR_LIT:name>' not in spec) or ( '<STR_LIT:id>' in spec and '<STR_LIT:name>' in spec ):<EOL><INDENT>raise NipapMissingInputError('''<STR_LIT>''')<EOL><DEDENT>self._check_pool_attr(attr)<EOL>where, params1 = self._expand_pool_spec(spec)<EOL>update, params2 = self._sql_expand_update(attr)<EOL>params = dict(params2.items() + params1.items())<EOL>pools = self.list_pool(auth, spec)<EOL>sql = "<STR_LIT>" + update<EOL>sql += "<STR_LIT>" + where<EOL>sql += "<STR_LIT>"<EOL>self._execute(sql, params)<EOL>updated_pools = self._get_updated_rows(auth, self.search_pool)<EOL>audit_params = {<EOL>'<STR_LIT:username>': auth.username,<EOL>'<STR_LIT>': auth.authenticated_as,<EOL>'<STR_LIT>': auth.full_name,<EOL>'<STR_LIT>': auth.authoritative_source<EOL>}<EOL>for p in pools:<EOL><INDENT>audit_params['<STR_LIT>'] = p['<STR_LIT:id>']<EOL>audit_params['<STR_LIT>'] = p['<STR_LIT:name>']<EOL>audit_params['<STR_LIT:description>'] = '<STR_LIT>' % (p['<STR_LIT:name>'], unicode(attr))<EOL>sql, params = self._sql_expand_insert(audit_params)<EOL>self._execute('<STR_LIT>' % sql, params)<EOL><DEDENT>return updated_pools<EOL>
Update pool given by `spec` with attributes `attr`.

            * `auth` [BaseAuth]
                AAA options.
            * `spec` [pool_spec]
                Specifies what pool to edit.
            * `attr` [pool_attr]
                Attributes to update and their new values.

            This is the documentation of the internal backend function. It's
            exposed over XML-RPC, please also see the XML-RPC documentation for
            :py:func:`nipap.xmlrpc.NipapXMLRPC.edit_pool` for full
            understanding.