@requires_rw<EOL><INDENT>def edit_vrf(self, auth, spec, attr):<DEDENT>
self._logger.debug("<STR_LIT>" %<EOL>(unicode(spec), unicode(attr)))<EOL>self._check_attr(attr, [], _vrf_attrs)<EOL>vrfs = self.list_vrf(auth, spec)<EOL>where, params1 = self._expand_vrf_spec(spec)<EOL>update, params2 = self._sql_expand_update(attr)<EOL>params = dict(params2.items() + params1.items())<EOL>if len(attr) == <NUM_LIT:0>:<EOL><INDENT>raise NipapInputError("<STR_LIT>")<EOL><DEDENT>sql = "<STR_LIT>" + update<EOL>sql += "<STR_LIT>" + where<EOL>sql += "<STR_LIT>"<EOL>self._execute(sql, params)<EOL>updated_vrfs = self._get_updated_rows(auth, self.search_vrf)<EOL>for v in vrfs:<EOL><INDENT>audit_params = {<EOL>'<STR_LIT>': v['<STR_LIT:id>'],<EOL>'<STR_LIT>': v['<STR_LIT>'],<EOL>'<STR_LIT>': v['<STR_LIT:name>'],<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>'<STR_LIT:description>': '<STR_LIT>' % (v['<STR_LIT>'], unicode(attr))<EOL>}<EOL>sql, params = self._sql_expand_insert(audit_params)<EOL>self._execute('<STR_LIT>' % sql, params)<EOL><DEDENT>return updated_vrfs<EOL>
Update VRFs matching `spec` with attributes `attr`.

            * `auth` [BaseAuth]
                AAA options.
            * `spec` [vrf_spec]
                Attibutes specifying what VRF to edit.
            * `attr` [vrf_attr]
                Dict specifying fields to be updated 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_vrf` for full
            understanding.