def _process_identify_futures(self, futures, opts, instances): self.out.debug('scan._process_identify_futures') checkpoint = datetime.now() i = 0 to_scan = {} cancelled = False for future in as_completed(futures): if common.shutdown: if not cancelled: map(lambda x: x.cancel(), futures) cancelled = True continue url = future.url try: cms_name, result_tuple = future.result(timeout=opts['timeout_host']) if cms_name != None: if cms_name not in to_scan: to_scan[cms_name] = [] to_scan[cms_name].append(result_tuple) except: f.exc_handle(url, self.out, self.app.testing) i += 1 if to_scan: self._process_scan(opts, instances, to_scan) to_scan = {}
def _process_identify_futures(self, futures, opts, instances): self.out.debug('scan._process_identify_futures') checkpoint = datetime.now() i = 0 to_scan = {} for future in as_completed(futures): url = future.url try: cms_name, result_tuple = future.result( timeout=opts['timeout_host']) if cms_name != None: if cms_name not in to_scan: to_scan[cms_name] = [] to_scan[cms_name].append(result_tuple) except: f.exc_handle(url, self.out, self.app.testing) i += 1 if to_scan: self._process_scan(opts, instances, to_scan) to_scan = {}
def _process_identify_futures(self, futures, opts, instances): self.out.debug('scan._process_identify_futures') checkpoint = datetime.now() i = 0 to_scan = {} cancelled = False for future in as_completed(futures): if common.shutdown: if not cancelled: map(lambda x: x.cancel(), futures) cancelled = True continue url = future.url try: cms_name, result_tuple = future.result( timeout=opts['timeout_host']) if cms_name != None: if cms_name not in to_scan: to_scan[cms_name] = [] to_scan[cms_name].append(result_tuple) except: f.exc_handle(url, self.out, self.app.testing) i += 1 if to_scan: self._process_scan(opts, instances, to_scan) to_scan = {}
def _process_results_multisite(self, results, functionality, timeout_host): for result in results: try: if common.shutdown: result['future'].cancel() continue output = result['future'].result(timeout=timeout_host) self._output_json_add_info(output, result['url']) if not common.shutdown: self.out.result(output, functionality) except: if self.app != None: testing = self.app.testing else: testing = None f.exc_handle(result['url'], self.out, testing)
def _process_results_multisite(self, results, functionality, timeout_host): for result in results: try: if common.shutdown: result['future'].cancel() continue output = result['future'].result(timeout=timeout_host) output['host'] = result['url'] output['cms_name'] = self._meta.label if not common.shutdown: self.out.result(output, functionality) except: if self.app != None: testing = self.app.testing else: testing = None f.exc_handle(result['url'], self.out, testing)
def _process_identify_futures(self, futures, opts, instances): self.out.debug('scan._process_identify_futures') checkpoint = datetime.now() i = 0 to_scan = {} for future in as_completed(futures): url = future.url try: cms_name, result_tuple = future.result(timeout=opts['timeout_host']) if cms_name != None: if cms_name not in to_scan: to_scan[cms_name] = [] to_scan[cms_name].append(result_tuple) except: f.exc_handle(url, self.out, self.app.testing) i += 1 if to_scan: self._process_scan(opts, instances, to_scan) to_scan = {}