@@ -78,7 +78,8 @@ class AclLoader(object):
7878 POLICER = "POLICER"
7979 SESSION_PREFIX = "everflow"
8080 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"
8283 ACL_ACTION_CAPABILITY_FIELD = "ACL_ACTION"
8384
8485 min_priority = 1
@@ -402,16 +403,18 @@ def validate_actions(self, table_name, action_props):
402403 # Same information should be there in all state DB's
403404 # as it is static information about switch capability
404405 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 ))
406408 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 ))
408411 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 :
411414 del action_props [action_key ]
412415 continue
413416
414- values = capability [ key ].split ("," )
417+ values = aclcapability [ action_list_key ].split ("," )
415418 if action_key .upper () not in values :
416419 del action_props [action_key ]
417420 continue
@@ -420,11 +423,11 @@ def validate_actions(self, table_name, action_props):
420423 # Check if action_value is supported
421424 action_value = action_props [action_key ]
422425 key = "{}|{}" .format (self .ACL_ACTION_CAPABILITY_FIELD , action_key .upper ())
423- if key not in capability :
426+ if key not in switchcapability :
424427 del action_props [action_key ]
425428 continue
426429
427- if action_value not in capability [key ]:
430+ if action_value not in switchcapability [key ]:
428431 del action_props [action_key ]
429432 continue
430433
0 commit comments