#NEWLINE# def __init__( self , ks_session = None , verify_ssl = False , **credentials ) : #NEWLINE# #INDENT# self . keystone_session = ks_session #NEWLINE# if ( not self . keystone_session ) : #NEWLINE# #INDENT# auth_plugin = v2 . Password ( ** credentials ) #NEWLINE# self . keystone_session = keystone_session . Session ( auth = auth_plugin , verify = verify_ssl ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . keystone_session . get_token ( ) #NEWLINE# #UNINDENT# except ( keystone_exceptions . AuthorizationFailure , keystone_exceptions . ConnectionRefused ) as e : #NEWLINE# #INDENT# six . reraise ( OpenStackBackendError , e ) #NEWLINE# #UNINDENT# for opt in ( 'auth_ref' , 'auth_url' , 'tenant_id' , 'tenant_name' ) : #NEWLINE# #INDENT# self [ opt ] = getattr ( self . auth , opt )