(self, outer_instance, network, portstart, portend, extra_ports)
| 1231 | if data.get('Failed_Pings', 0) >= 30: |
| 1232 | self.logger.debug(f"Host {mac} in degraded state ({data.get('Failed_Pings', 0)} failed pings)") |
| 1233 | |
| 1234 | self.logger.info(f"✅ Updated SQLite database with {len(sorted_netkb_entries)} hosts") |
| 1235 | |
| 1236 | except Exception as db_error: |
| 1237 | self.logger.error(f"Failed to write to SQLite database: {db_error}") |
| 1238 | self.logger.debug(f"Traceback: {traceback.format_exc()}") |
| 1239 | # Don't raise - CSV write succeeded, so continue |
| 1240 | |
| 1241 | except Exception as e: |
| 1242 | self.logger.error(f"Error in update_netkb: {e}") |
| 1243 | |
| 1244 | def display_csv(self, file_path): |
| 1245 | """ |
| 1246 | Displays the contents of the specified CSV file using Rich for enhanced visualization. |
| 1247 | """ |
| 1248 | if not Table or not self.console: |
| 1249 | return |
| 1250 | with self.lock: |
| 1251 | try: |
| 1252 | table = Table(title=f"Contents of {file_path}", show_lines=True) |
| 1253 | with open(file_path, 'r') as file: |
| 1254 | reader = csv.reader(file) |
| 1255 | headers = next(reader) |
| 1256 | for header in headers: |
nothing calls this directly
no test coverage detected