@@ -78,7 +78,8 @@ class AclLoader(object):
78
78
POLICER = "POLICER"
79
79
SESSION_PREFIX = "everflow"
80
80
SWITCH_CAPABILITY_TABLE = "SWITCH_CAPABILITY"
81
- ACL_ACTIONS_CAPABILITY_FIELD = "ACL_ACTIONS"
81
+ ACL_STAGE_CAPABILITY_TABLE = "ACL_STAGE_CAPABILITY_TABLE"
82
+ ACL_ACTIONS_CAPABILITY_FIELD = "action_list"
82
83
ACL_ACTION_CAPABILITY_FIELD = "ACL_ACTION"
83
84
84
85
min_priority = 1
@@ -402,16 +403,18 @@ def validate_actions(self, table_name, action_props):
402
403
# Same information should be there in all state DB's
403
404
# as it is static information about switch capability
404
405
namespace_statedb = list (self .per_npu_statedb .values ())[0 ]
405
- capability = namespace_statedb .get_all (self .statedb .STATE_DB , "{}|switch" .format (self .SWITCH_CAPABILITY_TABLE ))
406
+ aclcapability = namespace_statedb .get_all (self .statedb .STATE_DB , "{}|{}" .format (self .ACL_STAGE_CAPABILITY_TABLE , stage .upper ()))
407
+ switchcapability = namespace_statedb .get_all (self .statedb .STATE_DB , "{}|switch" .format (self .SWITCH_CAPABILITY_TABLE ))
406
408
else :
407
- capability = self .statedb .get_all (self .statedb .STATE_DB , "{}|switch" .format (self .SWITCH_CAPABILITY_TABLE ))
409
+ aclcapability = self .statedb .get_all (self .statedb .STATE_DB , "{}|{}" .format (self .ACL_STAGE_CAPABILITY_TABLE , stage .upper ()))
410
+ switchcapability = self .statedb .get_all (self .statedb .STATE_DB , "{}|switch" .format (self .SWITCH_CAPABILITY_TABLE ))
408
411
for action_key in dict (action_props ):
409
- key = "{}|{}" . format ( self .ACL_ACTIONS_CAPABILITY_FIELD , stage . upper ())
410
- if key not in capability :
412
+ action_list_key = self .ACL_ACTIONS_CAPABILITY_FIELD
413
+ if action_list_key not in aclcapability :
411
414
del action_props [action_key ]
412
415
continue
413
416
414
- values = capability [ key ].split ("," )
417
+ values = aclcapability [ action_list_key ].split ("," )
415
418
if action_key .upper () not in values :
416
419
del action_props [action_key ]
417
420
continue
@@ -420,11 +423,11 @@ def validate_actions(self, table_name, action_props):
420
423
# Check if action_value is supported
421
424
action_value = action_props [action_key ]
422
425
key = "{}|{}" .format (self .ACL_ACTION_CAPABILITY_FIELD , action_key .upper ())
423
- if key not in capability :
426
+ if key not in switchcapability :
424
427
del action_props [action_key ]
425
428
continue
426
429
427
- if action_value not in capability [key ]:
430
+ if action_value not in switchcapability [key ]:
428
431
del action_props [action_key ]
429
432
continue
430
433
0 commit comments