def merge_dicts(d1, d2):
    """
    Merge values from d2 into d1 ignoring empty / None values.

    :type d1: ``dict``
    :type d2: ``dict``

    :rtype: ``dict``
    """
    result = copy.deepcopy(d1)

    for key, value in six.iteritems(d2):
        if isinstance(value, dict):
            result[key] = merge_dicts(result[key], value)
        elif key not in result or value is not None:
            result[key] = value

    return result

    Merge values from d2 into d1 ignoring empty / None values.

    :type d1: ``dict``
    :type d2: ``dict``

    :rtype: ``dict``
    
st2client/st2client/utils/misc.py