def data_diffs(local_data, host_data, fields=None):
    """
    Find all (relevant) fields which differ between the host and local data
    values for a given record.
    """
    if fields is None:
        fields = list(local_data)
    diffs = []
    for field in fields:
        if field not in local_data:
            raise KeyError("key '{}' is missing from local_data".format(field))
        if field not in host_data:
            raise KeyError("key '{}' is missing from host_data".format(field))
        if local_data[field] != host_data[field]:
            diffs.append(field)
    return diffs
