data_cloud: remove compat methods and tests

This commit is contained in:
pared
2019-07-18 10:29:40 +02:00
parent 14c4a9c52f
commit e39be6d1aa
6 changed files with 0 additions and 69 deletions
-12
View File
@@ -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
-3
View File
@@ -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):
-7
View File
@@ -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 (
-7
View File
@@ -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
-7
View File
@@ -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(
-33
View File
@@ -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()