Handle puppet process death.
(self)
| 595 | return False |
| 596 | |
| 597 | def _on_process_died(self): |
| 598 | """Handle puppet process death.""" |
| 599 | # Flush log before stopping |
| 600 | self.launcher.flush_log() |
| 601 | self._stop_puppet() |
| 602 | |
| 603 | # Try to read log file for error details |
| 604 | log_path = self.launcher.get_log_path() |
| 605 | error_msg = "Puppet process died unexpectedly" |
| 606 | try: |
| 607 | if os.path.exists(log_path): |
| 608 | with open(log_path, 'r') as f: |
| 609 | log_content = f.read() |
| 610 | if log_content: |
| 611 | # Show last few lines of log |
| 612 | lines = log_content.strip().split('\n') |
| 613 | last_lines = lines[-5:] if len(lines) > 5 else lines |
| 614 | error_msg = f"Puppet died. Log: {' '.join(last_lines)}" |
| 615 | except Exception: |
| 616 | pass |
| 617 | |
| 618 | self._show_status(error_msg, "error") |
| 619 | |
| 620 | def _load_expressions(self): |
| 621 | """Load expressions from puppet.""" |
nothing calls this directly
no test coverage detected