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 )
def get_db_credentials(db_account)
def get_credentials(machine, authPath=None)
Definition: credentials.py:26