CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
credentials.py
Go to the documentation of this file.
1 import netrc
2 import os
3 
4 def get_credentials_from_file( service, authFile=None ):
5  creds = netrc.netrc( authFile ).authenticators(service)
6  return creds
7 
8 def get_credentials( authPathEnvVar, service, authFile=None ):
9  if authFile is None:
10  if authPathEnvVar in os.environ:
11  authPath = os.environ[authPathEnvVar]
12  authFile = os.path.join(authPath,'.netrc')
13  return get_credentials_from_file( service, authFile )
14 
def get_credentials
Definition: credentials.py:8
def get_credentials_from_file
Definition: credentials.py:4