Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:53

0001 #import FWCore.ParameterSet.Config as cms
0002 import CondCore.Utilities.credentials as credentials
0003 import socket
0004 
0005 db_service = 'cms_omds_adg'
0006 if socket.getfqdn().strip().endswith('.cms'):
0007     db_service = 'cms_omds_lb'
0008 
0009 def get_db_credentials( db_account ):
0010     machine = '%s/%s' %(db_service, db_account)
0011     creds = credentials.get_credentials( machine )
0012     if not creds is None:
0013         (username, account, pwd) = creds
0014         return db_service, username, pwd
0015     else:
0016         raise Exception('Entry for service %s not found in .netrc' %machine )