Skip to content

Commit 5294cff

Browse files
committed
Use tmp_fname from utils
1 parent 151a499 commit 5294cff

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

dvc/remote/gdrive/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import posixpath
55
import logging
6-
import uuid
76

87
from funcy import cached_property, retry, compose, decorator
98
from funcy.py3 import cat
@@ -14,6 +13,7 @@
1413
from dvc.remote.base import RemoteBASE
1514
from dvc.config import Config
1615
from dvc.exceptions import DvcException
16+
from dvc.utils import tmp_fname
1717

1818
logger = logging.getLogger(__name__)
1919

@@ -47,10 +47,6 @@ def _wrap_pydrive_retriable(call):
4747
)
4848

4949

50-
def get_tmp_filepath():
51-
return posixpath.join(".dvc", "tmp", str(uuid.uuid4()))
52-
53-
5450
class RemoteGDrive(RemoteBASE):
5551
scheme = Schemes.GDRIVE
5652
path_cls = CloudURLInfo
@@ -80,7 +76,7 @@ def init_drive(self):
8076
"https://man.dvc.org/remote/add."
8177
)
8278
self.gdrive_user_credentials_path = (
83-
get_tmp_filepath()
79+
tmp_fname(".dvc/tmp/")
8480
if os.getenv(RemoteGDrive.GDRIVE_USER_CREDENTIALS_DATA)
8581
else self.config.get(
8682
Config.SECTION_GDRIVE_USER_CREDENTIALS_FILE,

0 commit comments

Comments
 (0)