take an existing entity and a modified entity and check for changes.

def _check_for_changes(entity_type, ret, existing, modified):
    '''
    take an existing entity and a modified entity and check for changes.
    '''

    ret['result'] = True

    #were there any changes? generation always changes, remove it.

    if isinstance(existing, dict) and isinstance(modified, dict):
        if 'generation' in modified['content'].keys():
            del modified['content']['generation']

        if 'generation' in existing['content'].keys():
            del existing['content']['generation']

        if modified['content'] == existing['content']:
            ret['comment'] = '{entity_type} is currently enforced to the desired state.  No changes made.'.format(entity_type=entity_type)
        else:
            ret['comment'] = '{entity_type} was enforced to the desired state.  Note: Only parameters specified ' \
                             'were enforced. See changes for details.'.format(entity_type=entity_type)
            ret['changes']['old'] = existing['content']
            ret['changes']['new'] = modified['content']

    else:
        if modified == existing:
            ret['comment'] = '{entity_type} is currently enforced to the desired state.  No changes made.'.format(entity_type=entity_type)
        else:
            ret['comment'] = '{entity_type} was enforced to the desired state.  Note: Only parameters specified ' \
                             'were enforced. See changes for details.'.format(entity_type=entity_type)
            ret['changes']['old'] = existing
            ret['changes']['new'] = modified

    return ret