7 print "Cannot import cx_Oracle:", e
10 DATABASE =
"cms_orcoff_prep"
11 USERNAME =
"CMS_COND_REGRESSION"
13 AUTH_PATH =
"/afs/cern.ch/cms/DB/conddb/test/"
14 AUTH_FILE =
"authentication.xml"
18 pattern = re.compile(
r'value="([^"]+)')
19 matching = pattern.search(login)
25 pfile = open(auth,
"r")
26 plist = pfile.readlines()
27 for i
in range (0, len(plist)):
28 if string.find(plist[i],
'<connection name="'+connStr+
'">') != -1:
34 conn_string = str(USERNAME+
"/"+PASSWORD+
"@"+DATABASE)
35 conn = cx_Oracle.connect(conn_string)
39 os.environ[
'TNS_ADMIN'] =
"/afs/cern.ch/project/oracle/admin"
40 coralConnStr =
"oracle://"+DATABASE+
"/"+USERNAME+
""
41 authFilePath = os.path.join(AUTH_PATH,AUTH_FILE)
42 PASSWORD =
getLogin(authFilePath, coralConnStr)
43 return (coralConnStr,USERNAME,PASSWORD,AUTH_PATH)
def getDBConnectionParams