code: def _check_dir_meta(name,
                      user,
                      group,
                      mode,
                      follow_symlinks=False):
      '''
      Check the changes in directory metadata
      '''
      try:
          stats = __salt__['file.stats'](name, None, follow_symlinks)
      except CommandExecutionError:
          stats = {}
  
      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
      # Normalize the dir mode
      smode = salt.utils.files.normalize_mode(stats['mode'])
      mode = salt.utils.files.normalize_mode(mode)
      if mode is not None and mode != smode:
          changes['mode'] = mode
      return changef _check_dir_meta(name,
                      user,
                      group,
                      mode,
                      follow_symlinks=False):
      '''
      Check the changes in directory metadata
      '''
      try:
          stats = __salt__['file.stats'](name, None, follow_symlinks)
      except CommandExecutionError:
          stats = {}
  
      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
      # Normalize the dir mode
      smode = salt.utils.files.normalize_mode(stats['mode'])
      mode = salt.utils.files.normalize_mode(mode)
      if mode is not None and mode != smode:
          changes['mode'] = mode
      return changes
docs: Check the changes in directory metadata