CMS 3D CMS Logo

db_credentials.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import CondCore.Utilities.credentials as credentials
3 import socket
4 
5 authPathEnvVar = 'COND_AUTH_PATH'
6 db_service = 'cms_omds_adg'
7 if socket.getfqdn().strip().endswith('.cms'):
8  db_service = 'cms_omds_lb'
9 db_machine = db_service + '/CMS_ECAL_R'
10 
11 
13  creds = credentials.get_credentials( authPathEnvVar, db_machine )
14  if not creds is None:
15  (username, account, pwd) = creds
16  return db_service, username, pwd
17  else:
18  raise Exception('Entry for service %s not found in .netrc' %db_machine )
def get_credentials(authPathEnvVar, service, authFile=None)
Definition: credentials.py:13
def get_readOnly_db_credentials()