#NEWLINE# def populate_keypair_choices( self , request , context ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# keypairs = nova . keypair_list ( request ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# keypairs = [ ] #NEWLINE# exceptions . handle ( request , _ ( 'Unable to fetch keypair choices.' ) ) #NEWLINE# #UNINDENT# keypair_list = [ ( kp . name , kp . name ) for kp in keypairs ] #NEWLINE# keypair_list . insert ( 0 , ( '' , _ ( 'No keypair' ) ) ) #NEWLINE# return keypair_list