def db_set(table, record, column, value, if_exists=False):
    '''
    Sets a column's value for a specific record.

    Args:
        table: A string - name of the database table.
        record: A string - identifier of the record.
        column: A string - name of the column.
        value: A string - the value to be set
        if_exists: A boolean - if True, it is not an error if the record does
            not exist.

    Returns:
        None on success and an error message on failure.

    CLI Example:
    .. code-block:: bash

       salt '*' openvswitch.db_set Interface br0 mac 02:03:04:05:06:07
    '''
    cmd = ['ovs-vsctl']
    if if_exists:
        cmd += ['--if-exists']
    cmd += ['set', table, record, '{0}={1}'.format(column, json.dumps(value))]
    result = __salt__['cmd.run_all'](cmd)
    if result['retcode'] != 0:
        return result['stderr']
    else:
        return None
def db_set ( table , record , column , value , if_exists = False ) : cmd = [ 'ovs-vsctl' ] if if_exists : cmd += [ '--if-exists' ] cmd += [ 'set' , table , record , '{0}={1}' . format ( column , json . dumps ( value ) ) ] result = __salt__ [ 'cmd.run_all' ] ( cmd ) if result [ 'retcode' ] != 0 : return result [ 'stderr' ] else : return None
Sets a column's value for a specific record.

    Args:
        table: A string - name of the database table.
        record: A string - identifier of the record.
        column: A string - name of the column.
        value: A string - the value to be set
        if_exists: A boolean - if True, it is not an error if the record does
            not exist.

    Returns:
        None on success and an error message on failure.

    CLI Example:
    .. code-block:: bash

       salt '*' openvswitch.db_set Interface br0 mac 02:03:04:05:06:07