|
80 | 80 | "user_data = dict()\n", |
81 | 81 | "\n", |
82 | 82 | "# Set the filename to use for the backup workbook\n", |
83 | | - "WORKBOOK_FILENAME = 'exampleBackups/downloaded_rules_workbook_2020-12-03 live demo workbook.xlsx'" |
| 83 | + "WORKBOOK_FILENAME = 'exampleBackups/downloaded_rules_workbook_2020-12-01 backup with wan and vpn uplink prefs and cpcs.xlsx'" |
84 | 84 | ] |
85 | 85 | }, |
86 | 86 | { |
|
676 | 676 | "\n", |
677 | 677 | "\t# If there are any orphans left, they have not matched by ID or name. Create them new.\n", |
678 | 678 | "\tif len(list_of_orphan_loaded_performance_classes):\n", |
| 679 | + "\t\tprint(f'{len(list_of_orphan_loaded_performance_classes)} new custom performance classes need to be created:')\n", |
| 680 | + "\t\tprint(f'{list_of_orphan_loaded_performance_classes}\\n')\n", |
| 681 | + "\n", |
679 | 682 | "\t\tfor orphan_loaded_performance_class in list_of_orphan_loaded_performance_classes:\n", |
680 | 683 | "\t\t\t# Re-create the loaded class from the backup and get its new ID\n", |
681 | 684 | "\t\t\t# We'll also add the old and new IDs to the reference object we've created for this purpose\n", |
|
686 | 689 | "\t\t\t\tname=orphan_loaded_performance_class['name'],\n", |
687 | 690 | "\t\t\t\tmaxLossPercentage=orphan_loaded_performance_class['maxLossPercentage']\n", |
688 | 691 | "\t\t\t)\n", |
| 692 | + "\t\t\tprint(f'Created new custom performance class {new_performance_class} from the backup\\'s {orphan_loaded_performance_class}.\\n')\n", |
689 | 693 | "\t\t\t\n", |
690 | 694 | "\t\t\t# Add it to the name-only matches list, list_of_name_matches\n", |
691 | 695 | "\t\t\tlist_of_id_updates.append(\n", |
|
695 | 699 | "\t\t\t\t}\n", |
696 | 700 | "\t\t\t)\n", |
697 | 701 | "\n", |
698 | | - "\t\t\t# Remove it from the list of orphans\n", |
699 | | - "\t\t\tlist_of_orphan_loaded_performance_classes.remove(orphan_loaded_performance_class)\n", |
700 | | - "\n", |
| 702 | + "\tprint('These IDs from the backup will need to be updated:')\n", |
| 703 | + "\tprint(f'{list_of_id_updates}\\n\\n')\n", |
701 | 704 | "\t# Return the list of updated IDs in key-value pairs for later processing\n", |
702 | 705 | "\treturn(list_of_id_updates)" |
703 | 706 | ] |
|
0 commit comments