def _check_dir_meta(name, user, group, mode, follow_symlinks=False):
 stats = __salt__['file.stats'](name, None, follow_symlinks)
 changes = {}
 if (not stats):
  changes['directory'] = 'new'
  return changes
 if ((user is not None) and (user != stats['user']) and (user != stats.get('uid'))):
  changes['user'] = user
 if ((group is not None) and (group != stats['group']) and (group != stats.get('gid'))):
  changes['group'] = group
 smode = salt.utils.normalize_mode(stats['mode'])
 mode = salt.utils.normalize_mode(mode)
 if ((mode is not None) and (mode != smode)):
  changes['mode'] = mode
 return changes

def _check_dir_meta ( name , user , group , mode , follow_symlinks = False ) : stats = __salt__ [ 'file.stats' ] ( name , None , follow_symlinks ) changes = { } if ( not stats ) : changes [ 'directory' ] = 'new' return changes if ( ( user is not None ) and ( user != stats [ 'user' ] ) and ( user != stats . get ( 'uid' ) ) ) : changes [ 'user' ] = user if ( ( group is not None ) and ( group != stats [ 'group' ] ) and ( group != stats . get ( 'gid' ) ) ) : changes [ 'group' ] = group smode = salt . utils . normalize_mode ( stats [ 'mode' ] ) mode = salt . utils . normalize_mode ( mode ) if ( ( mode is not None ) and ( mode != smode ) ) : changes [ 'mode' ] = mode return changes
check the changes in directory metadata .