def add_node_capability(task, capability, value):
    """Add 'capability' to node's 'capabilities' property.

    If 'capability' is already present, then a duplicate entry
    will be added.

    :param task: Task object.
    :param capability: Capability key.
    :param value: Capability value.

    """
    node = task.node
    properties = node.properties
    capabilities = properties.get('capabilities')
    new_cap = ':'.join([capability, value])
    if capabilities:
        capabilities = ','.join([capabilities, new_cap])
    else:
        capabilities = new_cap
    properties['capabilities'] = capabilities
    node.properties = properties
    node.save()
