#NEWLINE# def _rule_args_to_dict( self , context , to_port = None , from_port = None , ip_protocol = None , cidr = None , group_id = None ) : #NEWLINE# #INDENT# if ( group_id is not None ) : #NEWLINE# #INDENT# group_id = self . security_group_api . validate_id ( group_id ) #NEWLINE# self . security_group_api . get ( context , id = group_id ) #NEWLINE# return self . security_group_api . new_group_ingress_rule ( group_id , ip_protocol , from_port , to_port ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cidr = self . security_group_api . parse_cidr ( cidr ) #NEWLINE# return self . security_group_api . new_cidr_ingress_rule ( cidr , ip_protocol , from_port , to_port )