@@ -536,29 +536,27 @@ func (c *Config) getTokenSource(clientScopes []string, initialCredentialsOnly bo
536536// of those "projects" as well. You can find out if this is required by looking at
537537// the basePath value in the client library file.
538538func (c * Config ) NewComputeClient (userAgent string ) * compute.Service {
539- computeClientBasePath := c .ComputeBasePath + "projects/"
540- log .Printf ("[INFO] Instantiating GCE client for path %s" , computeClientBasePath )
539+ log .Printf ("[INFO] Instantiating GCE client for path %s" , c .ComputeBasePath )
541540 clientCompute , err := compute .NewService (c .context , option .WithHTTPClient (c .client ))
542541 if err != nil {
543542 log .Printf ("[WARN] Error creating client compute: %s" , err )
544543 return nil
545544 }
546545 clientCompute .UserAgent = userAgent
547- clientCompute .BasePath = computeClientBasePath
546+ clientCompute .BasePath = c . ComputeBasePath
548547
549548 return clientCompute
550549}
551550
552551func (c * Config ) NewComputeBetaClient (userAgent string ) * computeBeta.Service {
553- computeBetaClientBasePath := c .ComputeBetaBasePath + "projects/"
554- log .Printf ("[INFO] Instantiating GCE Beta client for path %s" , computeBetaClientBasePath )
552+ log .Printf ("[INFO] Instantiating GCE Beta client for path %s" , c .ComputeBetaBasePath )
555553 clientComputeBeta , err := computeBeta .NewService (c .context , option .WithHTTPClient (c .client ))
556554 if err != nil {
557555 log .Printf ("[WARN] Error creating client compute beta: %s" , err )
558556 return nil
559557 }
560558 clientComputeBeta .UserAgent = userAgent
561- clientComputeBeta .BasePath = computeBetaClientBasePath
559+ clientComputeBeta .BasePath = c . ComputeBetaBasePath
562560
563561 return clientComputeBeta
564562}
0 commit comments