mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
data_cloud: remove compat methods and tests
This commit is contained in:
@@ -181,15 +181,6 @@ class Config(object): # pylint: disable=too-many-instance-attributes
|
||||
Optional(SECTION_CACHE_SLOW_LINK_WARNING, default=True): BOOL_SCHEMA,
|
||||
}
|
||||
|
||||
# backward compatibility
|
||||
SECTION_CORE_CLOUD = "cloud"
|
||||
SECTION_CORE_CLOUD_SCHEMA = And(
|
||||
Use(str.lower),
|
||||
# only the clouds which were supported by obsoleted cloud config
|
||||
Choices("aws", "gcp", "local", ""),
|
||||
)
|
||||
SECTION_CORE_STORAGEPATH = "storagepath"
|
||||
|
||||
SECTION_CORE_SCHEMA = {
|
||||
Optional(SECTION_CORE_LOGLEVEL): And(
|
||||
str, Use(str.lower), SECTION_CORE_LOGLEVEL_SCHEMA
|
||||
@@ -204,9 +195,6 @@ class Config(object): # pylint: disable=too-many-instance-attributes
|
||||
Optional(
|
||||
SECTION_CORE_CHECKSUM_JOBS, default=None
|
||||
): SECTION_CORE_CHECKSUM_JOBS_SCHEMA,
|
||||
# backward compatibility
|
||||
Optional(SECTION_CORE_CLOUD, default=""): SECTION_CORE_CLOUD_SCHEMA,
|
||||
Optional(SECTION_CORE_STORAGEPATH, default=""): str,
|
||||
}
|
||||
|
||||
# backward compatibility
|
||||
|
||||
@@ -124,9 +124,6 @@ class RemoteBASE(object):
|
||||
path_info=self.path_info or "No path",
|
||||
)
|
||||
|
||||
def compat_config(config):
|
||||
return config.copy()
|
||||
|
||||
@classmethod
|
||||
def supported(cls, config):
|
||||
if isinstance(config, basestring):
|
||||
|
||||
@@ -35,13 +35,6 @@ class RemoteGS(RemoteBASE):
|
||||
self.projectname = config.get(Config.SECTION_GCP_PROJECTNAME, None)
|
||||
self.credentialpath = config.get(Config.SECTION_GCP_CREDENTIALPATH)
|
||||
|
||||
@staticmethod
|
||||
def compat_config(config):
|
||||
ret = config.copy()
|
||||
url = "gs://" + ret.pop(Config.SECTION_GCP_STORAGEPATH, "").lstrip("/")
|
||||
ret[Config.SECTION_REMOTE_URL] = url
|
||||
return ret
|
||||
|
||||
@cached_property
|
||||
def gs(self):
|
||||
return (
|
||||
|
||||
@@ -91,13 +91,6 @@ class RemoteLOCAL(RemoteBASE):
|
||||
def supported(cls, config):
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def compat_config(config):
|
||||
ret = config.copy()
|
||||
url = ret.pop(Config.SECTION_LOCAL_STORAGEPATH, "")
|
||||
ret[Config.SECTION_REMOTE_URL] = url
|
||||
return ret
|
||||
|
||||
def list_cache_paths(self):
|
||||
assert self.path_info is not None
|
||||
|
||||
|
||||
@@ -70,13 +70,6 @@ class RemoteS3(RemoteBASE):
|
||||
if shared_creds:
|
||||
os.environ.setdefault("AWS_SHARED_CREDENTIALS_FILE", shared_creds)
|
||||
|
||||
@staticmethod
|
||||
def compat_config(config):
|
||||
ret = config.copy()
|
||||
url = "s3://" + ret.pop(Config.SECTION_AWS_STORAGEPATH, "").lstrip("/")
|
||||
ret[Config.SECTION_REMOTE_URL] = url
|
||||
return ret
|
||||
|
||||
@cached_property
|
||||
def s3(self):
|
||||
session = boto3.session.Session(
|
||||
|
||||
@@ -569,15 +569,6 @@ class TestDataCloudCLIBase(TestDvc):
|
||||
self._test()
|
||||
|
||||
|
||||
class TestCompatRemoteLOCALCLI(TestDataCloudCLIBase):
|
||||
def _test(self):
|
||||
storagepath = get_local_storagepath()
|
||||
self.main(["config", "core.cloud", "local"])
|
||||
self.main(["config", "local.storagepath", storagepath])
|
||||
|
||||
self._test_cloud()
|
||||
|
||||
|
||||
class TestRemoteLOCALCLI(TestDataCloudCLIBase):
|
||||
def _test(self):
|
||||
url = get_local_url()
|
||||
@@ -611,18 +602,6 @@ class TestRemoteHDFSCLI(TestDataCloudCLIBase):
|
||||
self._test_cloud(TEST_REMOTE)
|
||||
|
||||
|
||||
class TestCompatRemoteS3CLI(TestDataCloudCLIBase):
|
||||
def _should_test(self):
|
||||
return _should_test_aws()
|
||||
|
||||
def _test(self):
|
||||
storagepath = get_aws_storagepath()
|
||||
self.main(["config", "core.cloud", "aws"])
|
||||
self.main(["config", "aws.storagepath", storagepath])
|
||||
|
||||
self._test_cloud()
|
||||
|
||||
|
||||
class TestRemoteS3CLI(TestDataCloudCLIBase):
|
||||
def _should_test(self):
|
||||
return _should_test_aws()
|
||||
@@ -635,18 +614,6 @@ class TestRemoteS3CLI(TestDataCloudCLIBase):
|
||||
self._test_cloud(TEST_REMOTE)
|
||||
|
||||
|
||||
class TestCompatRemoteGSCLI(TestDataCloudCLIBase):
|
||||
def _should_test(self):
|
||||
return _should_test_gcp()
|
||||
|
||||
def _test(self):
|
||||
storagepath = get_gcp_storagepath()
|
||||
self.main(["config", "core.cloud", "gcp"])
|
||||
self.main(["config", "gcp.storagepath", storagepath])
|
||||
|
||||
self._test_cloud()
|
||||
|
||||
|
||||
class TestRemoteGSCLI(TestDataCloudCLIBase):
|
||||
def _should_test(self):
|
||||
return _should_test_gcp()
|
||||
|
||||
Reference in New Issue
Block a user