tensorflow/core/platform/cloud/google_auth_provider.cc
/// Returns the well known file produced by command 'gcloud auth login'.
Returns the well known file produced by command 'gcloud auth login'.
Returns the well known file produced by command ' gcloud auth login ' .
Status GetWellKnownFileName(string* filename) {
  if (!filename) {
    return errors::FailedPrecondition("'filename' cannot be nullptr.");
  }
  string config_dir;
  const char* config_dir_override = std::getenv(kCloudSdkConfig);
  if (config_dir_override) {
    config_dir = config_dir_override;
  } else {
    const char* home_dir = std::getenv("HOME");
    if (!home_dir) {
      return errors::FailedPrecondition("Could not read $HOME.");
    }
    config_dir = io::JoinPath(home_dir, kGCloudConfigFolder);
  }
  auto result = io::JoinPath(config_dir, kWellKnownCredentialsFile);
  if (!IsFile(result)) {
    return errors::NotFound(
        "Could not find the credentials file in the standard gcloud location.");
  }
  *filename = result;
  return Status::OK();
}
Status GetWellKnownFileName ( string * filename ) { if ( ! filename ) { return errors :: FailedPrecondition ( " " ) ; } string config_dir ; const char * config_dir_override = std :: getenv ( kCloudSdkConfig ) ; if ( config_dir_override ) { config_dir = config_dir_override ; } else { const char * home_dir = std :: getenv ( " " ) ; if ( ! home_dir ) { return errors :: FailedPrecondition ( " " ) ; } config_dir = io :: JoinPath ( home_dir , kGCloudConfigFolder ) ; } auto result = io :: JoinPath ( config_dir , kWellKnownCredentialsFile ) ; if ( ! IsFile ( result ) ) { return errors :: NotFound ( " " ) ; } * filename = result ; return Status :: OK ( ) ; }
Returns the well known file produced by command 'gcloud auth login'.
Returns the well known file produced by command ' gcloud auth login ' .
// Determine the home dir path.