#NEWLINE# def connect( self ) : #NEWLINE# #INDENT# self . client = VIServer ( ) #NEWLINE# trace_file = os . environ . get ( 'LIBCLOUD_DEBUG' , None ) #NEWLINE# try : #NEWLINE# #INDENT# self . client . connect ( host = self . host_or_url , user = self . user_id , password = self . key , sock_timeout = DEFAULT_CONNECTION_TIMEOUT , trace_file = trace_file ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# message = e . message #NEWLINE# fault = getattr ( e , 'fault' , None ) #NEWLINE# if ( fault == 'InvalidLoginFault' ) : #NEWLINE# #INDENT# raise InvalidCredsError ( message ) #NEWLINE# #UNINDENT# raise LibcloudError ( value = message , driver = self . driver ) #NEWLINE# #UNINDENT# atexit . register ( self . disconnect )