diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/CoolHelper.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/CoolHelper.py index d48768a855093a4c9450efcfff70a1494c934e23..f1197bd72fc6af19ac007ce645039310c7d79df0 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/CoolHelper.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/CoolHelper.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -import sys +import sys, os from PyCool import cool,coral from CoolConvUtilities import AtlCoolTool from AtlDataSummary.AtlDataSumLumiData import LumiBCIDData @@ -16,7 +16,27 @@ def openDb(MONP = False, TDAQ = False): if MONP : schemaName = "MONP200" accountName = "ATLAS_COOLONL_TRIGGER" if TDAQ : accountName = "ATLAS_COOLONL_TDAQ" - dbstring="oracle://ATLAS_COOLPROD;schema="+accountName+";dbname="+schemaName+";user=ATLAS_COOL_READER;password=COOLRED4PRO" + # Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 + # see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml + connName="oracle://ATLAS_COOLPROD/"+accountName # aka. schema + dbauthPath=os.environ.get('CORAL_AUTH_PATH') + dbpw = None + dbuser = None + # Get username and password by parsing authentication XML file + authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") + authenticationList = authenticationXmlDoc.getElementsByTagName("connection") + for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value + dbstring="oracle://ATLAS_COOLPROD;schema="+accountName+";dbname="+schemaName+";user="+dbuser+";password="+dbpw + #olddbstring="oracle://ATLAS_COOLPROD;schema="+accountName+";dbname="+schemaName+";user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" + try: db=dbSvc.openDatabase(dbstring,False) except Exception,e: @@ -449,7 +469,27 @@ def readLhcFillNumber(run): iovrange = IOVRange(starttime = startTime, endtime = endTime) lhcfolder = '/LHC/DCS/FILLSTATE' - dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_DCS;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" + # Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 + # see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml + connName="oracle://ATLAS_COOLPROD/ATLAS_COOLOFL_DCS" # the old online one: ATLAS_COOLONL_DCS is not in this file + dbauthPath=os.environ.get('CORAL_AUTH_PATH') + dbpw = None + dbuser = None + # Get username and password by parsing authentication XML file + authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") + authenticationList = authenticationXmlDoc.getElementsByTagName("connection") + for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value + dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_DCS;dbname=COMP200;user="+dbuser+";password="+dbpw + #olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_DCS;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" + try: dbSvc=cool.DatabaseSvcFactory.databaseService() db=dbSvc.openDatabase(dbstring,False) diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/ReadPbmCounters.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/ReadPbmCounters.py index 13cd7c051a0d115852ba6dd9959170dc519b2d8d..ec9753d2a50c2f29231e1aca4d0f4b0f95143682 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/ReadPbmCounters.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/ReadPbmCounters.py @@ -65,7 +65,26 @@ if (run == -1 or len(lbList) == 0) : # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" try: db=dbSvc.openDatabase(dbstring,False) @@ -147,7 +166,28 @@ db.closeDatabase() #################################### # < -- # now read further trigger counters -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=MONP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" + +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=MONP200;user="+dbuser+";password="+dbpw +#dear user - why not dbname=COMP200? +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=MONP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" #dbstring = "TRIG_PIT/MONP200" try: db=dbSvc.openDatabase(dbstring,False) diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/check_ctp_deadtime.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/check_ctp_deadtime.py index dee806db49a91de85bbe13a08f1db38386032d3e..dc5fd94ad9bc83a9572cd6d25784a6a862ece3b3 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/check_ctp_deadtime.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/check_ctp_deadtime.py @@ -39,7 +39,26 @@ if (run == -1 or inFile == '') : # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" try: db=dbSvc.openDatabase(dbstring,False) diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_livetime.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_livetime.py index f0c8498ff371403237fb534d27cccc256e1041e2..ea7f9c4ff4ebd5ff2297c403ea9464776ca0a322 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_livetime.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_livetime.py @@ -47,7 +47,26 @@ if (run == -1) : # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" try: db=dbSvc.openDatabase(dbstring,False) diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates.py index 7317016330cf8f8bf089954531086b093f8adc0c..b4e1ac5f3d82b8edb11194c7caf24781d1075713 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates.py @@ -100,7 +100,26 @@ if printNumbers and printRates : # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" #dbstring="sqlite://;schema=/afs/cern.ch/user/b/berge/trash/ctp.LBData.1190647872.sqlitefile.db;dbname=L1CTCOOL" try: diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates_get_lumi.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates_get_lumi.py index 0cd70e61172501d2b72dca8719a9024df589a53a..540d7c07375960a549a988b8d9d8fc73e6a889cf 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates_get_lumi.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/cool_read_lvl1rates_get_lumi.py @@ -103,7 +103,26 @@ if printNumbers and printRates : # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" #dbstring="sqlite://;schema=/afs/cern.ch/user/b/berge/trash/ctp.LBData.1190647872.sqlitefile.db;dbname=L1CTCOOL" try: diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/fillLVL1histograms.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/fillLVL1histograms.py index 193e730c7e72fa25f2d3e35a0ba7a7053f75515f..4278eab36e1a8ef531ee413406a0d94e2b347bed 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/fillLVL1histograms.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/fillLVL1histograms.py @@ -31,7 +31,26 @@ print # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" try: db=dbSvc.openDatabase(dbstring,False) diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/l1ctpy.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/l1ctpy.py index b81bdfec0e14b2c1c8c6379153ca7b719c1e90a0..9bc4efc00f668e7bfae6d7d2c83eb73b4e084f48 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/l1ctpy.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/l1ctpy.py @@ -19,8 +19,26 @@ ORBIT_FREQUENCY = 40.0790e6 / 3564. #+================================================================ _COOLDBOWNER='' - -_COOLDB="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=DBNAME;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=DBNAME;user="+dbuser+";password="+dbpw +#old_COOLDB="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=DBNAME;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" def get_dbid_MONP(owner=False): if owner: @@ -38,7 +56,26 @@ def get_dbid_COMP(owner=False): def get_dbid_TDAQ_COMP(owner=False): - _COOLDB="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TDAQ;dbname=DBNAME;user=ATLAS_COOL_READER;password=COOLRED4PRO" + # Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 + # see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml + connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema + dbauthPath=os.environ.get('CORAL_AUTH_PATH') + dbpw = None + dbuser = None + # Get username and password by parsing authentication XML file + authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") + authenticationList = authenticationXmlDoc.getElementsByTagName("connection") + for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value + _COOLDB="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=DBNAME;user="+dbuser+";password="+dbpw + #old_COOLDB="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TDAQ;dbname=DBNAME;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" if owner: print "NO OWNER ACCOUNT IMPLEMENTED" return _COOLDBOWNER.replace("DBNAME","COMP200") diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/read_bunchgroups.py b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/read_bunchgroups.py index 9e046a1044f4cc9a1f9b4e52501d0f588f91d6b3..18f816658041c79d724999946ed25e00665015e9 100755 --- a/Trigger/TrigT1/TrigT1CTMonitoring/scripts/read_bunchgroups.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/scripts/read_bunchgroups.py @@ -44,7 +44,26 @@ if (run == -1) : # get database service and open database dbSvc=cool.DatabaseSvcFactory.databaseService() -dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=COOLRED4PRO" +# Get user and passwd from coral auth file - see: https://its.cern.ch/jira/browse/ATR-25572 +# see this package in case the following doesn't work for you: Database/ConnectionManagement/AtlasAuthentication/data/dblookup.xml +connName="oracle://ATLAS_COOLPROD/ATLAS_COOLONL_TRIGGER" # aka. schema +dbauthPath=os.environ.get('CORAL_AUTH_PATH') +dbpw = None +dbuser = None +# Get username and password by parsing authentication XML file +authenticationXmlDoc = minidom.parse(dbauthPath + "authentication.xml") +authenticationList = authenticationXmlDoc.getElementsByTagName("connection") +for entry in authenticationList: + if entry.attributes["name"].value == connName: + parameters = entry.getElementsByTagName("parameter") + # Set username and password from authentication parameters + for parameter in parameters: + if parameter.attributes["name"].value == "user": + dbuser = parameter.attributes["value"].value + elif parameter.attributes["name"].value == "password": + dbpw = parameter.attributes["value"].value +dbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user="+dbuser+";password="+dbpw +#olddbstring="oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=COMP200;user=ATLAS_COOL_READER;password=PAssWDusedTObeHEREinPLAINtext" #dbstring="sqlite://;schema=/afs/cern.ch/user/b/berge/trash/ctp.LBData.1190647872.sqlitefile.db;dbname=L1CTCOOL" try: