-
Notifications
You must be signed in to change notification settings - Fork 6
/
device_configs.py
81 lines (68 loc) · 1.4 KB
/
device_configs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
raw_input_data = {
"hostname": "ROS-SC01-1-C104A-ORc",
"model": "xxx-yyy-zzz",
"management": "",
"ip": "",
}
model_options = [
"c1",
"b2",
"N3K",
"N3K",
"N5K",
"N7K",
"N9K",
]
input_data = {
"hostname": "ROS-SC01-1-C104A-OR",
"site_code": "ROS",
"raw_switch_type": "SC01",
"switch_type": "SC",
"sequence_number": "01",
"state": "OR",
"model": "c1",
"management": "",
"ip": "10.0.0.1",
}
class Device:
def __init__(self):
# TODO LOAD FROM EXTERNAL FILE
self.config = core = {
"a": [
"AAA",
"BBB",
"CCC",
],
"b": [
"XXX",
"YYY",
"ZZZ",
]
}
self.config_additions = {}
self.subtractions = {}
self.replacements = {}
def additions(self):
for key in self.additions:
self.config[key] = self.additions[key]
def subtractions(self):
for key in self.additions:
self.config[key] = self.additions[key]
def replacements(self):
pass
class N9K(Device):
pass
DEVICES = {
"N9K" : N9K
}
device = DEVICES[device_name]()
# output = f"""
# {
# "source" : "{p.server}",
# "target" : "{p.server}",
# "user" : "{p.username}",
# "passwd" : "{p.password}",
# }
# """
#
# print(output)