original_docstring: 
          Return a file hash, the hash type is set in the master config file
          
docstring: Return a file hash, the hash type is set in the master config file
docstring_tokens: Return a file hash the hash type is set in the master config file
code: def file_hash(self, load, fnd):
          '''
          Return a file hash, the hash type is set in the master config file
          '''
          if 'env' in load:
              salt.utils.warn_until(
                  'Oxygen',
                  'Parameter \'env\' has been detected in the argument list.  This '
                  'parameter is no longer used and has been replaced by \'saltenv\' '
                  'as of Salt 2016.11.0.  This warning will be removed in Salt Oxygen.'
                  )
              load.pop('env')
  
          if not all(x in load for x in ('path', 'saltenv')):
              return '', None
          ret = {'hash_type': self.opts['hash_type']}
          relpath = fnd['rel']
          path = fnd['path']
          hashdest = salt.utils.path_join(self.hash_cachedir,
                                          load['saltenv'],
                                          '{0}.hash.{1}'.format(relpath,
                                                                self.opts['hash_type']))
          if not os.path.isfile(hashdest):
              if not os.path.exists(os.path.dirname(hashdest)):
                  os.makedirs(os.path.dirname(hashdest))
              ret['hsum'] = salt.utils.get_hash(path, self.opts['hash_type'])
              with salt.utils.fopen(hashdest, 'w+') as fp_:
                  fp_.write(ret['hsum'])
              return ret
          else:
              with salt.utils.fopen(hashdest, 'rb') as fp_:
                  ret['hsum'] = fp_.read()
              return ret
code_tokens: def file_hash ( self , load , fnd ) : if 'env' in load : salt . utils . warn_until ( 'Oxygen' , 'Parameter \'env\' has been detected in the argument list.  This ' 'parameter is no longer used and has been replaced by \'saltenv\' ' 'as of Salt 2016.11.0.  This warning will be removed in Salt Oxygen.' ) load . pop ( 'env' ) if not all ( x in load for x in ( 'path' , 'saltenv' ) ) : return '' , None ret = { 'hash_type' : self . opts [ 'hash_type' ] } relpath = fnd [ 'rel' ] path = fnd [ 'path' ] hashdest = salt . utils . path_join ( self . hash_cachedir , load [ 'saltenv' ] , '{0}.hash.{1}' . format ( relpath , self . opts [ 'hash_type' ] ) ) if not os . path . isfile ( hashdest ) : if not os . path . exists ( os . path . dirname ( hashdest ) ) : os . makedirs ( os . path . dirname ( hashdest ) ) ret [ 'hsum' ] = salt . utils . get_hash ( path , self . opts [ 'hash_type' ] ) with salt . utils . fopen ( hashdest , 'w+' ) as fp_ : fp_ . write ( ret [ 'hsum' ] ) return ret else : with salt . utils . fopen ( hashdest , 'rb' ) as fp_ : ret [ 'hsum' ] = fp_ . read ( ) return ret
short_docstring: Return a file hash, the hash type is set in the master config file
short_docstring_tokens: Return a file hash the hash type is set in the master config file
comment: '''
          Return a file hash, the hash type is set in the master config file
          '''