def _get_gcp_libcloud_credentials(service_account_email=None, credentials_file=None, project_id=None):
 if ((service_account_email is None) or (credentials_file is None)):
  try:
   import secrets
   display.deprecated(msg=("secrets file found at '%s'.  This method of specifying credentials is deprecated.  Please use env vars or Ansible YAML files instead" % secrets.__file__), version=2.5)
  except ImportError:
   secrets = None
  if hasattr(secrets, 'GCE_PARAMS'):
   if (not service_account_email):
    service_account_email = secrets.GCE_PARAMS[0]
   if (not credentials_file):
    credentials_file = secrets.GCE_PARAMS[1]
  keyword_params = getattr(secrets, 'GCE_KEYWORD_PARAMS', {})
  if (not project_id):
   project_id = keyword_params.get('project', None)
 return (service_account_email, credentials_file, project_id)

def _get_gcp_libcloud_credentials ( service_account_email = None , credentials_file = None , project_id = None ) : if ( ( service_account_email is None ) or ( credentials_file is None ) ) : try : import secrets display . deprecated ( msg = ( "secrets file found at '%s'.  This method of specifying credentials is deprecated.  Please use env vars or Ansible YAML files instead" % secrets . __file__ ) , version = 2.5 ) except ImportError : secrets = None if hasattr ( secrets , 'GCE_PARAMS' ) : if ( not service_account_email ) : service_account_email = secrets . GCE_PARAMS [ 0 ] if ( not credentials_file ) : credentials_file = secrets . GCE_PARAMS [ 1 ] keyword_params = getattr ( secrets , 'GCE_KEYWORD_PARAMS' , { } ) if ( not project_id ) : project_id = keyword_params . get ( 'project' , None ) return ( service_account_email , credentials_file , project_id )
helper to look for libcloud secrets .