(self, operation, result)
| 194 | return False |
| 195 | |
| 196 | async def parse(self, operation, result): |
| 197 | if self.status != 0: |
| 198 | return |
| 199 | for parser in self.executor.parsers: |
| 200 | source_facts = operation.source.facts if operation else [] |
| 201 | try: |
| 202 | relationships = await self._parse_link_result(result, parser, source_facts) |
| 203 | |
| 204 | if len(relationships) > 0 and relationships[0] == PARSER_SIGNALS_FAILURE: |
| 205 | logging.getLogger('link').debug(f'link {self.id} (ability id={self.ability.ability_id}) encountered ' |
| 206 | f'an error during execution, which was caught during parsing.') |
| 207 | self.status = self.states['ERROR'] |
| 208 | relationships = [] # we didn't actually get anything out of this, so let's reset |
| 209 | else: |
| 210 | await self.create_relationships(relationships, operation) |
| 211 | await update_scores(operation, increment=len(relationships), used=self.used, facts=self.facts) |
| 212 | except Exception as e: |
| 213 | logging.getLogger('link').debug('error in %s while parsing ability %s: %s' |
| 214 | % (parser.module, self.ability.ability_id, e)) |
| 215 | |
| 216 | def apply_id(self, host): |
| 217 | self.id = str(uuid.uuid4()) |
no test coverage detected