Skip to content

Commit

Permalink
Merge pull request #4371 from mozilla/fix-json-check-mpp-3467
Browse files Browse the repository at this point in the history
MPP-3467: Fix check for Google Application Credentials
  • Loading branch information
say-yawn authored Feb 1, 2024
2 parents e8f717c + dd37908 commit 0326a8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions privaterelay/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class PrivateRelayConfig(AppConfig):
name = "privaterelay"

def ready(self) -> None:
if settings.GOOGLE_APPLICATION_CREDENTIALS is not None:
if settings.GOOGLE_APPLICATION_CREDENTIALS:
# Set up Google Cloud Profiler
service, version = get_profiler_startup_data()
if service != None:
import googlecloudprofiler

# Make sure the expect gcp_key.json file exists
gcp_key_json_path = Path(settings.GOOGLE_APPLICATION_CREDENTIALS)
if gcp_key_json_path.exists():
if gcp_key_json_path.exists() and gcp_key_json_path.is_file():
with gcp_key_json_path.open() as gcp_key_file:
try:
# Make sure the expect gcp_key.json file is valid json
Expand Down

0 comments on commit 0326a8f

Please sign in to comment.