Skip to content
10 changes: 9 additions & 1 deletion capirca/aclgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from capirca.lib import speedway
from capirca.lib import srxlo
from capirca.lib import windows_advfirewall
from capirca.lib import fortigate
Comment thread
Ali-aqrabawi marked this conversation as resolved.
Outdated


FLAGS = flags.FLAGS
Expand Down Expand Up @@ -174,6 +175,7 @@ def RenderFile(input_file, output_directory, definitions,
win_afw = False
xacl = False
paloalto = False
fcl = False

try:
conf = open(input_file).read()
Expand Down Expand Up @@ -238,6 +240,8 @@ def RenderFile(input_file, output_directory, definitions,
paloalto = copy.deepcopy(pol)
if 'cloudarmor' in platforms:
gca = copy.deepcopy(pol)
if 'fortigate' in platforms:
fcl = copy.deepcopy(pol)

if not output_directory.endswith('/'):
output_directory += '/'
Expand Down Expand Up @@ -327,11 +331,15 @@ def RenderFile(input_file, output_directory, definitions,
acl_obj = cloudarmor.CloudArmor(gca, exp_info)
RenderACL(str(acl_obj), acl_obj.SUFFIX, output_directory,
input_file, write_files)
if fcl:
acl_obj = fortigate.Fortigate(fcl, exp_info)
RenderACL(str(acl_obj), acl_obj.SUFFIX, output_directory,
input_file, write_files)
# TODO(robankeny) add additional errors.
except (juniper.Error, junipersrx.Error, cisco.Error, ipset.Error,
Comment thread
Ali-aqrabawi marked this conversation as resolved.
iptables.Error, speedway.Error, pcap.Error,
aclgenerator.Error, aruba.Error, nftables.Error, gce.Error,
cloudarmor.Error) as e:
cloudarmor.Error, fortigate.Error) as e:
raise ACLGeneratorError(
'Error generating target ACL for %s:\n%s' % (input_file, e))

Expand Down
Loading