@@ -629,9 +629,11 @@ def __init__(
629
629
"gpu_instance" : self .gpu_instance ,
630
630
"bootstrap" : self .bootstrap ,
631
631
"auto_shutdown" : self .auto_shutdown ,
632
- "preemptible" : preemptible
633
- if preemptible is not None
634
- else self .config .get ("preemptible" ),
632
+ "preemptible" : (
633
+ preemptible
634
+ if preemptible is not None
635
+ else self .config .get ("preemptible" )
636
+ ),
635
637
"instance_labels" : instance_labels or self .config .get ("instance_labels" ),
636
638
"service_account" : service_account or self .config .get ("service_account" ),
637
639
}
@@ -662,16 +664,23 @@ def refresh_client(self):
662
664
if self .service_account_credentials :
663
665
import google .oauth2 .service_account # google-auth
664
666
665
- credentials = google .oauth2 .service_account .Credentials .from_service_account_info (
666
- self .service_account_credentials ,
667
- scopes = ["https://www.googleapis.com/auth/cloud-platform" ],
667
+ credentials = (
668
+ google .oauth2 .service_account .Credentials .from_service_account_info (
669
+ self .service_account_credentials ,
670
+ scopes = ["https://www.googleapis.com/auth/cloud-platform" ],
671
+ )
668
672
)
669
673
else :
670
674
# Obtain Application Default Credentials
671
675
credentials , _ = google .auth .default ()
672
676
673
677
# Use the credentials to build a service client
674
- return googleapiclient .discovery .build ("compute" , "v1" , credentials = credentials )
678
+ return googleapiclient .discovery .build (
679
+ "compute" ,
680
+ "v1" ,
681
+ credentials = credentials ,
682
+ requestBuilder = build_request (credentials ),
683
+ )
675
684
676
685
def instances (self ):
677
686
try :
0 commit comments