#NEWLINE# def _handle_redirect_action( self , context , policy_rule_set_ids , providing_ptg = None ) : #NEWLINE# #INDENT# policy_rule_sets = context . _plugin . get_policy_rule_sets ( context . _plugin_context , filters = { #NEWLINE# #INDENT# 'id' : policy_rule_set_ids , #NEWLINE# #UNINDENT# } ) #NEWLINE# for policy_rule_set in policy_rule_sets : #NEWLINE# #INDENT# if providing_ptg : #NEWLINE# #INDENT# ptgs_providing_prs = [ providing_ptg ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not policy_rule_set [ 'providing_policy_target_groups' ] ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ptgs_providing_prs = context . _plugin . get_policy_target_groups ( context . _plugin_context . elevated ( ) , { #NEWLINE# #INDENT# 'id' : policy_rule_set [ 'providing_policy_target_groups' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# parent_classifier_id = None #NEWLINE# parent_spec_id = None #NEWLINE# if policy_rule_set [ 'parent_id' ] : #NEWLINE# #INDENT# parent = context . _plugin . get_policy_rule_set ( context . _plugin_context , policy_rule_set [ 'parent_id' ] ) #NEWLINE# policy_rules = context . _plugin . get_policy_rules ( context . _plugin_context , filters = { #NEWLINE# #INDENT# 'id' : parent [ 'policy_rules' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# for policy_rule in policy_rules : #NEWLINE# #INDENT# policy_actions = context . _plugin . get_policy_actions ( context . _plugin_context , filters = { #NEWLINE# #INDENT# 'id' : policy_rule [ 'policy_actions' ] , #NEWLINE# 'action_type' : [ gconst . GP_ACTION_REDIRECT ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# if policy_actions : #NEWLINE# #INDENT# parent_spec_id = policy_actions [ 0 ] . get ( 'action_value' ) #NEWLINE# parent_classifier_id = policy_rule . get ( 'policy_classifier_id' ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# policy_rules = context . _plugin . get_policy_rules ( context . _plugin_context , filters = { #NEWLINE# #INDENT# 'id' : policy_rule_set [ 'policy_rules' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# for policy_rule in policy_rules : #NEWLINE# #INDENT# hierarchial_classifier_mismatch = False #NEWLINE# classifier_id = policy_rule . get ( 'policy_classifier_id' ) #NEWLINE# if ( parent_classifier_id and ( parent_classifier_id != classifier_id ) ) : #NEWLINE# #INDENT# hierarchial_classifier_mismatch = True #NEWLINE# #UNINDENT# policy_actions = context . _plugin . get_policy_actions ( context . _plugin_context , filters = { #NEWLINE# #INDENT# 'id' : policy_rule . get ( 'policy_actions' ) , #NEWLINE# 'action_type' : [ gconst . GP_ACTION_REDIRECT ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( self . _is_redirect_in_policy_rule_sets ( context , policy_rule_set_ids ) and ( not policy_actions ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# spec_id = ( ( policy_actions and policy_actions [ 0 ] [ 'action_value' ] ) or None ) #NEWLINE# for ptg_providing_prs in ptgs_providing_prs : #NEWLINE# #INDENT# if ( not ptg_providing_prs . get ( 'proxied_group_id' ) ) : #NEWLINE# #INDENT# self . _create_or_update_chain ( context , ptg_providing_prs [ 'id' ] , SCI_CONSUMER_NOT_AVAILABLE , spec_id , parent_spec_id , classifier_id , hierarchial_classifier_mismatch , policy_rule_set )