#NEWLINE# def get_form_kwargs( self ) : #NEWLINE# #INDENT# kwargs = super ( AddRuleView , self ) . get_form_kwargs ( ) #NEWLINE# try : #NEWLINE# #INDENT# groups = api . network . security_group_list ( self . request ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# groups = [ ] #NEWLINE# exceptions . handle ( self . request , _ ( 'Unable to retrieve security groups.' ) ) #NEWLINE# #UNINDENT# security_groups = [ ] #NEWLINE# for group in groups : #NEWLINE# #INDENT# if ( group . id == filters . get_int_or_uuid ( self . kwargs [ 'security_group_id' ] ) ) : #NEWLINE# #INDENT# security_groups . append ( ( group . id , ( _ ( '%s (current)' ) % group . name ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# security_groups . append ( ( group . id , group . name ) ) #NEWLINE# #UNINDENT# #UNINDENT# kwargs [ 'sg_list' ] = security_groups #NEWLINE# return kwargs