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 db_service = 'cms_omds_adg'
6 if socket.getfqdn().strip().endswith('.cms'):
7  db_service = 'cms_omds_lb'
8 
9 def get_db_credentials( db_account ):
10  machine = '%s/%s' %(db_service, db_account)
11  creds = credentials.get_credentials( machine )
12  if not creds is None:
13  (username, account, pwd) = creds
14  return db_service, username, pwd
15  else:
16  raise Exception('Entry for service %s not found in .netrc' %machine )
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
db_credentials.get_db_credentials
def get_db_credentials(db_account)
Definition: db_credentials.py:9
Exception
credentials.get_credentials
def get_credentials(service, authPath=None)
Definition: credentials.py:16