#NEWLINE# def __init__( self , session = None , verify_ssl = False , **credentials ) : #NEWLINE# #INDENT# self . verify_ssl = verify_ssl #NEWLINE# if session : #NEWLINE# #INDENT# if isinstance ( session , dict ) : #NEWLINE# #INDENT# logger . info ( 'Trying to recover OpenStack session.' ) #NEWLINE# self . session = OpenStackSession . recover ( session , verify_ssl = verify_ssl ) #NEWLINE# self . session . validate ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . session = session #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . session = OpenStackSession ( verify_ssl = verify_ssl , ** credentials ) #NEWLINE# #UNINDENT# except AttributeError as e : #NEWLINE# #INDENT# logger . error ( 'Failed to create OpenStack session.' ) #NEWLINE# six . reraise ( OpenStackBackendError , e )