- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.py
More file actions
Latest commit
executable file
·37 lines (27 loc) · 992 Bytes
/
Copy pathparse.py
File metadata and controls
executable file
·37 lines (27 loc) · 992 Bytes
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
#!/usr/bin/env python
from __future__ importunicode_literals, print_function
importre
importyaml
importjson
frompprintimportpprintaspp
fromciscoconfparseimportCiscoConfParse
# Excercise 8
print("\n\n ** Excercise 8 print crypto maps **")
cisco_cfg=CiscoConfParse("cisco_ipsec.txt")
formy_mapincisco_cfg.find_objects(r"^crypto map CRYPTO") :
map_entries=my_map.all_children
print("\n")
pp(my_map.text)
forstatementinmap_entries :
pp(statement.text)
# Excercise 9
print("\n\n ** Excercise 9: show crypto Maps using PFS group2 **")
formy_mapincisco_cfg.find_objects_w_child(parentspec=r"^crypto map CRYPTO", childspec=r"pfs group2") :
pp(my_map.text)
# Excercise 10
print("\n\n ** Excercise 10: show crypto maps not using AES based transform sets")
fortransformincisco_cfg.find_objects(r"set transform-set") :
ifnot"AES"intransform.text :
my_map=transform.parent
print(my_map.text)
print(transform.text)