#NEWLINE# def authorize_security_group( self , context , rule_body ) : #NEWLINE# #INDENT# nova = clients . nova ( context ) #NEWLINE# try : #NEWLINE# #INDENT# os_security_group_rule = nova . security_group_rules . create ( os_security_group_rule [ 'security_group_id' ] , rule_body . get ( 'protocol' ) , rule_body . get ( 'port_range_min' , ( - 1 ) ) , rule_body . get ( 'port_range_max' , ( - 1 ) ) , rule_body . get ( 'remote_ip_prefix' ) , rule_body . get ( 'remote_group_id' ) ) #NEWLINE# #UNINDENT# except nova_exception . Conflict : #NEWLINE# #INDENT# raise exception . InvalidPermissionDuplicate ( ) #NEWLINE# #UNINDENT# except nova_exception . OverLimit : #NEWLINE# #INDENT# raise exception . RulesPerSecurityGroupLimitExceeded ( )