Ensures that the named label is set on the named node
    with the given value.
    If the label exists it will be replaced.

    name
        The name of the label.

    value
        Value of the label.

    node
        Node to change.

def node_label_present(
        name,
        node,
        value,
        **kwargs):
    '''
    Ensures that the named label is set on the named node
    with the given value.
    If the label exists it will be replaced.

    name
        The name of the label.

    value
        Value of the label.

    node
        Node to change.
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    labels = __salt__['kubernetes.node_labels'](node, **kwargs)

    if name not in labels:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'The label is going to be set'
            return ret
        __salt__['kubernetes.node_add_label'](label_name=name,
                                              label_value=value,
                                              node_name=node,
                                              **kwargs)
    elif labels[name] == value:
        ret['result'] = True
        ret['comment'] = 'The label is already set and has the specified value'
        return ret
    else:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'The label is going to be updated'
            return ret

        ret['comment'] = 'The label is already set, changing the value'
        __salt__['kubernetes.node_add_label'](
            node_name=node,
            label_name=name,
            label_value=value,
            **kwargs)

    old_labels = copy.copy(labels)
    labels[name] = value

    ret['changes']['{0}.{1}'.format(node, name)] = {
        'old': old_labels,
        'new': labels}
    ret['result'] = True

    return ret