version: improve link type detection fall back (#4479)

* version: improve link type detection fall back

If failed to determine cache type print link to related web page.

Fixes #2788

* Update dvc/command/version.py

* fix formatting

Co-authored-by: Ruslan Kuprieiev <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ivan Rubanov
2020-09-03 12:03:56 +03:00
committed by GitHub
co-authored by Ruslan Kuprieiev Ruslan Kuprieiev
parent 4901765cd4
commit d460d18942
+2 -8
View File
@@ -10,7 +10,7 @@ from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.exceptions import DvcException, NotDvcRepoError
from dvc.scm.base import SCMError
from dvc.system import System
from dvc.utils import relpath
from dvc.utils import error_link
from dvc.utils.pkg import PKG
from dvc.version import __version__
@@ -59,13 +59,7 @@ class CmdVersion(CmdBaseNoRepo):
fs_type = self.get_fs_type(repo.cache.local.cache_dir)
info.append(f"Cache directory: {fs_type}")
else:
logger.warning(
"Unable to detect supported link types, as cache "
"directory '{}' doesn't exist. It is usually auto-created "
"by commands such as `dvc add/fetch/pull/run/import`, "
"but you could create it manually to enable this "
"check.".format(relpath(repo.cache.local.cache_dir))
)
info.append("Cache types: " + error_link("no-dvc-cache"))
except NotDvcRepoError:
root_directory = os.getcwd()