Skip to content

Commit 7c9bcc7

Browse files
authored
Use updated google auth method (nebari-dev#3186)
1 parent b3ba59b commit 7c9bcc7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/_nebari/provider/cloud/google_cloud.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
from typing import List, Set
55

66
import google.api_core.exceptions
7-
from google.auth import load_credentials_from_dict, load_credentials_from_file
7+
from google.auth import load_credentials_from_dict
88
from google.cloud import compute_v1, container_v1, iam_admin_v1, storage
9+
from google.oauth2 import service_account
910

1011
from _nebari.constants import GCP_ENV_DOCS
1112
from _nebari.provider.cloud.commons import filter_by_highest_supported_k8s_version
@@ -32,7 +33,9 @@ def load_credentials():
3233
# to determine if the credentials are stored as a file or not before
3334
# reading them
3435
if credentials.endswith(".json"):
35-
loaded_credentials, _ = load_credentials_from_file(credentials, scopes=scopes)
36+
loaded_credentials = service_account.Credentials.from_service_account_file(
37+
credentials, scopes=scopes
38+
)
3639
else:
3740
loaded_credentials, _ = load_credentials_from_dict(
3841
json.loads(credentials), scopes=scopes

0 commit comments

Comments
 (0)