def _return(self, load):
        '''
        Handle the return data sent from the minions
        '''
        # Generate EndTime
        endtime = salt.utils.jid.jid_to_time(salt.utils.jid.gen_jid(self.opts))
        # If the return data is invalid, just ignore it
        if any(key not in load for key in ('return', 'jid', 'id')):
            return False

        if load['jid'] == 'req':
            # The minion is returning a standalone job, request a jobid
            prep_fstr = '{0}.prep_jid'.format(self.opts['master_job_cache'])
            load['jid'] = self.mminion.returners[prep_fstr](nocache=load.get('nocache', False))

            # save the load, since we don't have it
            saveload_fstr = '{0}.save_load'.format(self.opts['master_job_cache'])
            self.mminion.returners[saveload_fstr](load['jid'], load)
        log.info('Got return from %s for job %s', load['id'], load['jid'])
        self.event.fire_event(load, load['jid'])  # old dup event
        self.event.fire_event(load, salt.utils.event.tagify([load['jid'], 'ret', load['id']], 'job'))
        self.event.fire_ret_load(load)
        if not self.opts['job_cache'] or self.opts.get('ext_job_cache'):
            return

        fstr = '{0}.update_endtime'.format(self.opts['master_job_cache'])
        if (self.opts.get('job_cache_store_endtime')
                and fstr in self.mminion.returners):
            self.mminion.returners[fstr](load['jid'], endtime)

        fstr = '{0}.returner'.format(self.opts['master_job_cache'])
        self.mminion.returners[fstr](load)
def _return ( self , load ) : endtime = salt . utils . jid . jid_to_time ( salt . utils . jid . gen_jid ( self . opts ) ) if any ( key not in load for key in ( 'return' , 'jid' , 'id' ) ) : return False if load [ 'jid' ] == 'req' : prep_fstr = '{0}.prep_jid' . format ( self . opts [ 'master_job_cache' ] ) load [ 'jid' ] = self . mminion . returners [ prep_fstr ] ( nocache = load . get ( 'nocache' , False ) ) saveload_fstr = '{0}.save_load' . format ( self . opts [ 'master_job_cache' ] ) self . mminion . returners [ saveload_fstr ] ( load [ 'jid' ] , load ) log . info ( 'Got return from %s for job %s' , load [ 'id' ] , load [ 'jid' ] ) self . event . fire_event ( load , load [ 'jid' ] ) self . event . fire_event ( load , salt . utils . event . tagify ( [ load [ 'jid' ] , 'ret' , load [ 'id' ] ] , 'job' ) ) self . event . fire_ret_load ( load ) if not self . opts [ 'job_cache' ] or self . opts . get ( 'ext_job_cache' ) : return fstr = '{0}.update_endtime' . format ( self . opts [ 'master_job_cache' ] ) if ( self . opts . get ( 'job_cache_store_endtime' ) and fstr in self . mminion . returners ) : self . mminion . returners [ fstr ] ( load [ 'jid' ] , endtime ) fstr = '{0}.returner' . format ( self . opts [ 'master_job_cache' ] ) self . mminion . returners [ fstr ] ( load )
Handle the return data sent from the minions