| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| """Module for fetching files used by test_analyzer.""" |
| |
| from __future__ import absolute_import |
| from __future__ import division |
| from __future__ import print_function |
| |
| import os |
| |
| |
| # Project configs |
| PROJECT_ID_PROD = 'chromiumos-test-analyzer' |
| PROJECT_ID_STAGING = 'chromeos-test-analyzer-staging' |
| |
| # Credential configs |
| _CREDS_PATH = os.path.join(os.path.dirname(__file__), 'credentials') |
| |
| |
| def GetServiceAccountCredentials(is_stage=True): |
| if not is_stage: |
| return os.path.join(_CREDS_PATH, |
| 'non_cipher/chromiumos-test-analyzer-prod.json') |
| else: |
| return os.path.join(_CREDS_PATH, |
| 'non_cipher/chromeos-test-analyzer-staging.json') |
| |
| |
| def GetCipherAPIKeyFile(is_stage=True): |
| if not is_stage: |
| return os.path.join(_CREDS_PATH, 'cipher/cipher_api_key.txt') |
| else: |
| return os.path.join(_CREDS_PATH, 'cipher/cipher_api_key_staging.txt') |