def _connect(uri):
 uri_l = uri.rsplit(' as ', 1)
 if (len(uri_l) == 2):
  (credentials, mode) = uri_l
  mode = MODE[mode]
 else:
  credentials = uri_l[0]
  mode = 0
 (userpass, hostportsid) = credentials.split('@')
 (user, password) = userpass.split('/')
 (hostport, sid) = hostportsid.split('/')
 hostport_l = hostport.split(':')
 if (len(hostport_l) == 2):
  (host, port) = hostport_l
 else:
  host = hostport_l[0]
  port = 1521
 log.debug('connect: {0}'.format((user, password, host, port, sid, mode)))
 os.environ['NLS_LANG'] = '.AL32UTF8'
 conn = cx_Oracle.connect(user, password, cx_Oracle.makedsn(host, port, sid), mode)
 conn.outputtypehandler = _unicode_output
 return conn

def _connect ( uri ) : uri_l = uri . rsplit ( ' as ' , 1 ) if ( len ( uri_l ) == 2 ) : ( credentials , mode ) = uri_l mode = MODE [ mode ] else : credentials = uri_l [ 0 ] mode = 0 ( userpass , hostportsid ) = credentials . split ( '@' ) ( user , password ) = userpass . split ( '/' ) ( hostport , sid ) = hostportsid . split ( '/' ) hostport_l = hostport . split ( ':' ) if ( len ( hostport_l ) == 2 ) : ( host , port ) = hostport_l else : host = hostport_l [ 0 ] port = 1521 log . debug ( 'connect: {0}' . format ( ( user , password , host , port , sid , mode ) ) ) os . environ [ 'NLS_LANG' ] = '.AL32UTF8' conn = cx_Oracle . connect ( user , password , cx_Oracle . makedsn ( host , port , sid ) , mode ) conn . outputtypehandler = _unicode_output return conn
return server object used to interact with jenkins .