Last active
July 9, 2020 19:05
-
-
Save nleiva/b863336ef4eff54d867b43439b4e8b50 to your computer and use it in GitHub Desktop.
get_acl.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from capirca.lib import cisco, juniper | |
def get_acl(inputs): | |
... | |
header = header_template.safe_substitute(inputs) | |
defs = naming.Naming(inputs['def_folder']) | |
terms = open(inputs['pol_file']).read() | |
pol = policy.ParsePolicy(header + '\n' + terms, defs, optimize=True) | |
... | |
if inputs['platform'] == 'juniper': | |
result = juniper.Juniper(pol, EXP_INFO) | |
elif inputs['platform'] == 'cisco': | |
result = cisco.Cisco(pol, EXP_INFO) | |
... | |
return str(result) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment