original_docstring: 
          Return a chunk from a file based on the data received
          
docstring: Return a chunk from a file based on the data received
docstring_tokens: Return a chunk from a file based on the data received
code: def serve_file(self, load, fnd):
          '''
          Return a chunk from a file based on the data received
          '''
          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')
  
          ret = {'data': '',
                 'dest': ''}
          required_load_keys = set(['path', 'loc', 'saltenv'])
          if not all(x in load for x in required_load_keys):
              log.debug(
                  'Not all of the required keys present in payload. '
                  'Missing: {0}'.format(
                      ', '.join(required_load_keys.difference(load))
                  )
              )
              return ret
          if not fnd['path']:
              return ret
          ret['dest'] = fnd['rel']
          gzip = load.get('gzip', None)
          with salt.utils.fopen(fnd['path'], 'rb') as fp_:
              fp_.seek(load['loc'])
              data = fp_.read(self.opts['file_buffer_size'])
              if gzip and data:
                  data = salt.utils.gzip_util.compress(data, gzip)
                  ret['gzip'] = gzip
              ret['data'] = data
          return ret
code_tokens: def serve_file ( 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' ) ret = { 'data' : '' , 'dest' : '' } required_load_keys = set ( [ 'path' , 'loc' , 'saltenv' ] ) if not all ( x in load for x in required_load_keys ) : log . debug ( 'Not all of the required keys present in payload. ' 'Missing: {0}' . format ( ', ' . join ( required_load_keys . difference ( load ) ) ) ) return ret if not fnd [ 'path' ] : return ret ret [ 'dest' ] = fnd [ 'rel' ] gzip = load . get ( 'gzip' , None ) with salt . utils . fopen ( fnd [ 'path' ] , 'rb' ) as fp_ : fp_ . seek ( load [ 'loc' ] ) data = fp_ . read ( self . opts [ 'file_buffer_size' ] ) if gzip and data : data = salt . utils . gzip_util . compress ( data , gzip ) ret [ 'gzip' ] = gzip ret [ 'data' ] = data return ret
short_docstring: Return a chunk from a file based on the data received
short_docstring_tokens: Return a chunk from a file based on the data received
comment: '''
          Return a chunk from a file based on the data received
          '''