Load the configuration from the shared configuration JSON file.
(self)
| 1519 | self._update_gamification_state() |
| 1520 | self.save_gamification_data() |
| 1521 | logger.info( |
| 1522 | f"Awarded {points_awarded} points for {new_mac_count} new MAC address(es). " |
| 1523 | f"Level {prev_level} -> {self.levelnbr}" |
| 1524 | ) |
| 1525 | |
| 1526 | return new_mac_count, points_awarded |
| 1527 | |
| 1528 | def delete_webconsolelog(self): |
| 1529 | """Delete the web console log file.""" |
| 1530 | try: |
| 1531 | if os.path.exists(self.webconsolelog): |
| 1532 | os.remove(self.webconsolelog) |
| 1533 | logger.info(f"Deleted web console log file at {self.webconsolelog}") |
| 1534 | #recreate the file |
| 1535 | |
| 1536 | else: |
| 1537 | logger.info(f"Web console log file not found at {self.webconsolelog} ...") |
| 1538 | |
| 1539 | except OSError as e: |
| 1540 | logger.error(f"OS error occurred while deleting web console log file: {e}") |
| 1541 | except Exception as e: |
| 1542 | logger.error(f"Unexpected error occurred while deleting web console log file: {e}") |
| 1543 | |
| 1544 | def create_livestatusfile(self): |
| 1545 | """Create the live status file, it will be used to store the current status of the scan.""" |
| 1546 | try: |
| 1547 | if not os.path.exists(self.livestatusfile): |
| 1548 | with open(self.livestatusfile, 'w', newline='') as csvfile: |
| 1549 | csvwriter = csv.writer(csvfile) |
| 1550 | csvwriter.writerow(['Total Open Ports', 'Alive Hosts Count', 'All Known Hosts Count', 'Vulnerabilities Count']) |
| 1551 | csvwriter.writerow([0, 0, 0, 0]) |
| 1552 | logger.info(f"Created live status file at {self.livestatusfile}") |
| 1553 | else: |
no test coverage detected