Skip to content

Commit 8c70958

Browse files
authored
Do not set gsutil credentials. (#1330)
User accounts credentials are no longer supported by `gsutil`. The recommendation is to use `gcloud storage` instead. See full details in bug. We will add a script tip in the notebook editor to tell users using `gsutil` to use `gcloud storage` instead. http://b/313996272
1 parent ba38086 commit 8c70958

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

patches/kaggle_secrets.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def set_gcloud_credentials(self, project=None, account=None):
9494
"""
9595
creds = self.get_gcloud_credential()
9696
creds_path = self._write_credentials_file(creds)
97-
self._write_gsutil_credentials_file(creds)
9897

9998
subprocess.run(['gcloud', 'config', 'set', 'auth/credential_file_override', creds_path])
10099

@@ -139,17 +138,6 @@ def _write_credentials_file(self, credentials) -> str:
139138

140139
return adc_path
141140

142-
def _write_gsutil_credentials_file(self, credentials) -> str:
143-
import json
144-
creds_dict = json.loads(credentials)
145-
boto_path = os.path.join(os.environ.get('HOME', '/'), '.boto')
146-
with open(boto_path, 'w') as f:
147-
f.write('[Credentials]\n')
148-
f.write(' gs_oauth2_refresh_token = ')
149-
f.write(creds_dict['refresh_token'])
150-
151-
return boto_path
152-
153141
def _get_gcs_access_token(self) -> Tuple[str, Optional[datetime]]:
154142
return self._get_access_token(GcpTarget.GCS)
155143

0 commit comments

Comments
 (0)