|
2 | 2 | from datetime import datetime |
3 | 3 | from netmiko import ConnectHandler |
4 | 4 | from ping3 import ping, verbose_ping |
5 | | -from vendor_backups import cisco,fortinet,huawei,juniper,microtik,vyos |
| 5 | +from vendor_backups import cisco_ios,cisco_asa,fortinet,huawei,juniper,microtik,vyos |
6 | 6 | import os |
7 | 7 | from tkinter import * |
8 | 8 | from tkinter.ttk import * |
@@ -53,34 +53,39 @@ def run_script(user_selection): |
53 | 53 | else: |
54 | 54 | # Based on user selection, run the script in the vendor_backups folder. The passed variables are hosts, username, password, and optional secret. |
55 | 55 | if user_selection == "1": |
56 | | - cisco.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2], list_of_rows[rows][3]) |
57 | | - backup_completion_popup(cisco.gui_filename_output) |
| 56 | + cisco_ios.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2], list_of_rows[rows][3]) |
| 57 | + backup_completion_popup(cisco_ios.gui_filename_output) |
58 | 58 | elif user_selection == "2": |
| 59 | + cisco_asa.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2], list_of_rows[rows][3]) |
| 60 | + backup_completion_popup(cisco_asa.gui_filename_output) |
| 61 | + elif user_selection == "3": |
59 | 62 | juniper.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2]) |
60 | 63 | backup_completion_popup(juniper.gui_filename_output) |
61 | | - elif user_selection == "3": |
| 64 | + elif user_selection == "4": |
62 | 65 | vyos.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2]) |
63 | 66 | backup_completion_popup(vyos.gui_filename_output) |
64 | | - elif user_selection == "4": |
| 67 | + elif user_selection == "5": |
65 | 68 | huawei.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2]) |
66 | 69 | backup_completion_popup(huawei.gui_filename_output) |
67 | | - elif user_selection == "5": |
| 70 | + elif user_selection == "6": |
68 | 71 | fortinet.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2]) |
69 | 72 | backup_completion_popup(fortinet.gui_filename_output) |
70 | | - elif user_selection == "6": |
| 73 | + elif user_selection == "7": |
71 | 74 | microtik.backup(list_of_rows[rows][0], list_of_rows[rows][1], list_of_rows[rows][2]) |
72 | 75 | backup_completion_popup(microtik.gui_filename_output) |
73 | 76 |
|
74 | 77 | # Build the button and assign values |
75 | | -tk_cisco = Button(tk_frame, text="Cisco", command=lambda : run_script("1")) |
76 | | -tk_juniper = Button(tk_frame, text="Juniper", command=lambda : run_script("2")) |
77 | | -tk_vyos = Button(tk_frame, text="VyOS", command=lambda : run_script("3")) |
78 | | -tk_huawei = Button(tk_frame, text="Huawei", command=lambda : run_script("4")) |
79 | | -tk_fortinet = Button(tk_frame, text="Fortinet", command=lambda : run_script("5")) |
80 | | -tk_microtik = Button(tk_frame, text="Microtik", command=lambda : run_script("6")) |
| 78 | +tk_cisco_ios = Button(tk_frame, text="Cisco IOS", command=lambda : run_script("1")) |
| 79 | +tk_cisco_asa = Button(tk_frame, text="Cisco ASA", command=lambda : run_script("2")) |
| 80 | +tk_juniper = Button(tk_frame, text="Juniper", command=lambda : run_script("3")) |
| 81 | +tk_vyos = Button(tk_frame, text="VyOS", command=lambda : run_script("4")) |
| 82 | +tk_huawei = Button(tk_frame, text="Huawei", command=lambda : run_script("5")) |
| 83 | +tk_fortinet = Button(tk_frame, text="Fortinet", command=lambda : run_script("6")) |
| 84 | +tk_microtik = Button(tk_frame, text="Microtik", command=lambda : run_script("7")) |
81 | 85 |
|
82 | 86 | # Place the button on the GUI |
83 | | -tk_cisco.pack(side=LEFT, padx=5, fill=BOTH, expand=True) |
| 87 | +tk_cisco_ios.pack(side=LEFT, padx=5, fill=BOTH, expand=True) |
| 88 | +tk_cisco_asa.pack(side=LEFT, padx=5, fill=BOTH, expand=True) |
84 | 89 | tk_juniper.pack(side=LEFT, padx=5, fill=BOTH, expand=True) |
85 | 90 | tk_vyos.pack(side=LEFT, padx=5, fill=BOTH, expand=True) |
86 | 91 | tk_huawei.pack(side=LEFT, padx=5, fill=BOTH, expand=True) |
|
0 commit comments