Octavia driver: rule list can be None in L7 policy

While converting an Octavia L7 rule object to a dict, the code should
handle the case when a L7 policy that is nested beneath the rule has a
None rule list.

Change-Id: Icae93a9e1cb1d5f09f4952fdfc1c2a1e3ad29123
This commit is contained in:
Kobi Samoray 2021-04-28 14:28:48 +03:00
parent 8d92b3e674
commit a8846ad60a
1 changed files with 2 additions and 0 deletions

View File

@ -378,6 +378,8 @@ class NSXOctaviaDriver(driver_base.ProviderDriver):
# During create operations, the created rule will not be
# retrieved from Octavia DB, as it is updated later on
if policy_dict.get('rules') is None:
policy_dict['rules'] = []
if (obj_dict['l7rule_id'] not in
[r['l7rule_id'] for r in
policy_dict.get('rules', [])]):