def update_port_for_ip_address(context, ip_id, id, port):
LOG.info("<STR_LIT>" % (id, context.tenant_id))<EOL>sanitize_list = ['<STR_LIT>']<EOL>with context.session.begin():<EOL><INDENT>addr = db_api.ip_address_find(context, id=ip_id, scope=db_api.ONE)<EOL>if not addr:<EOL><INDENT>raise q_exc.IpAddressNotFound(addr_id=ip_id)<EOL><DEDENT>port_db = db_api.port_find(context, id=id, scope=db_api.ONE)<EOL>if not port_db:<EOL><INDENT>raise q_exc.PortNotFound(port_id=id)<EOL><DEDENT>port_dict = {k: port['<STR_LIT:port>'][k] for k in sanitize_list}<EOL>require_da = False<EOL>service = port_dict.get('<STR_LIT>')<EOL>if require_da and _shared_ip_and_active(addr, except_port=id):<EOL><INDENT>raise q_exc.PortRequiresDisassociation()<EOL><DEDENT>addr.set_service_for_port(port_db, service)<EOL>context.session.add(addr)<EOL><DEDENT>return v._make_port_for_ip_dict(addr, port_db)<EOL>
Update values of a port.

    : param context: neutron api request context
    : param ip_id: UUID representing the ip associated with port to update
    : param id: UUID representing the port to update.
    : param port: dictionary with keys indicating fields to update.
        valid keys are those that have a value of True for 'allow_put'
        as listed in the RESOURCE_ATTRIBUTE_MAP object in
        neutron/api/v2/attributes.py.