Skip to content

Commit

Permalink
FWaaS: Only check gw port if we have one
Browse files Browse the repository at this point in the history
We might have some routers, which are FWaaS enabled but don't have a
gateway attached, so we need to protect against accessing attributes of
self.gateway_interface in case it is None.
  • Loading branch information
sebageek committed Jan 7, 2025
1 parent f5324e1 commit fae4e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asr1k_neutron_l3/models/neutron/l3/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ def _build_fwaas_conf(self):
fwaas_conf = []
fwaas_external_policies = {'ingress': None, 'egress': None}
for name, policy in router_info.get('fwaas_policies', {}).items():
if self.gateway_interface.id in policy['ingress_ports'] \
or self.gateway_interface.id in policy['egress_ports']:
if self.gateway_interface and (self.gateway_interface.id in policy['ingress_ports']
or self.gateway_interface.id in policy['egress_ports']):
# This policy will be bound on a external interface, so we need to create
# class-map and service-policy
if self.gateway_interface.id in policy['ingress_ports']:
Expand Down

0 comments on commit fae4e6c

Please sign in to comment.