def _check_for_changes(entity_type, ret, existing, modified):
 ret['result'] = True
 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 (cmp(modified['content'], existing['content']) == 0):
   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']
 elif (cmp(modified, existing) == 0):
  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

def _check_for_changes ( entity_type , ret , existing , modified ) : ret [ 'result' ] = True 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 ( cmp ( modified [ 'content' ] , existing [ 'content' ] ) == 0 ) : 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' ] elif ( cmp ( modified , existing ) == 0 ) : 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
take an existing entity and a modified entity and check for changes .