File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ def validate_and_get_data_from_binding_profile(port):
367
367
if (constants .OVN_PORT_BINDING_PROFILE not in port or
368
368
not validators .is_attr_set (
369
369
port [constants .OVN_PORT_BINDING_PROFILE ])):
370
- BPInfo ({}, None , [])
370
+ return BPInfo ({}, None , [])
371
371
param_set = {}
372
372
param_dict = {}
373
373
vnic_type = port .get (portbindings .VNIC_TYPE , portbindings .VNIC_NORMAL )
Original file line number Diff line number Diff line change @@ -711,6 +711,11 @@ def test_valid_input_surplus_keys(self):
711
711
{portbindings .VNIC_TYPE : portbindings .VNIC_DIRECT ,
712
712
constants .OVN_PORT_BINDING_PROFILE : binding_profile }))
713
713
714
+ def test_valid_input_no_binding_profile (self ):
715
+ # Confirm that we treat a port without binding:profile as valid
716
+ self .assertEqual (utils .BPInfo ({}, None , []),
717
+ utils .validate_and_get_data_from_binding_profile ({}))
718
+
714
719
def test_unknown_profile_items_pruned (self ):
715
720
# Confirm that unknown profile items are pruned
716
721
self .assertEqual (
You can’t perform that action at this time.
0 commit comments