def _check_touch(name, atime, mtime):
 if (not os.path.exists(name)):
  return (None, 'File {0} is set to be created'.format(name))
 stats = __salt__['file.stats'](name, follow_symlinks=False)
 if (atime is not None):
  if (str(atime) != str(stats['atime'])):
   return (None, 'Times set to be updated on file {0}'.format(name))
 if (mtime is not None):
  if (str(mtime) != str(stats['mtime'])):
   return (None, 'Times set to be updated on file {0}'.format(name))
 return (True, 'File {0} exists and has the correct times'.format(name))

def _check_touch ( name , atime , mtime ) : if ( not os . path . exists ( name ) ) : return ( None , 'File {0} is set to be created' . format ( name ) ) stats = __salt__ [ 'file.stats' ] ( name , follow_symlinks = False ) if ( atime is not None ) : if ( str ( atime ) != str ( stats [ 'atime' ] ) ) : return ( None , 'Times set to be updated on file {0}' . format ( name ) ) if ( mtime is not None ) : if ( str ( mtime ) != str ( stats [ 'mtime' ] ) ) : return ( None , 'Times set to be updated on file {0}' . format ( name ) ) return ( True , 'File {0} exists and has the correct times' . format ( name ) )
check to see if a file needs to be updated or created .