diff --git a/dvc/config.py b/dvc/config.py index b0d280b81..10b228b56 100644 --- a/dvc/config.py +++ b/dvc/config.py @@ -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 diff --git a/dvc/data_cloud.py b/dvc/data_cloud.py index d55eb86fd..3568ae4cb 100644 --- a/dvc/data_cloud.py +++ b/dvc/data_cloud.py @@ -60,12 +60,6 @@ class DataCloud(object): if remote: return self._init_remote(remote) - # Old config format support for backward compatibility - if Config.SECTION_CORE_CLOUD in self._core: - msg = "using obsoleted config format. Consider updating." - logger.warning(msg) - return self._init_compat() - raise ConfigError( "No remote repository specified. Setup default repository with\n" " dvc config core.remote \n" @@ -76,36 +70,6 @@ class DataCloud(object): def _init_remote(self, remote): return Remote(self.repo, name=remote) - def _init_compat(self): - name = self._core.get(Config.SECTION_CORE_CLOUD, "").strip().lower() - if name == "": - return None - - cloud_type = self.CLOUD_MAP.get(name, None) - if not cloud_type: - msg = "wrong cloud type '{}' specified".format(name) - raise ConfigError(msg) - - cloud_config = self._config.get(name, None) - if not cloud_config: - msg = "can't find cloud section '{}' in config".format(name) - raise ConfigError(msg) - - # NOTE: check if the class itself has everything needed for operation. - # E.g. all the imported packages. - if not cloud_type.supported(cloud_type.compat_config(cloud_config)): - raise ConfigError("unsupported cloud '{}'".format(name)) - - return self._init_cloud(cloud_config, cloud_type) - - def _init_cloud(self, cloud_config, cloud_type): - global_storage_path = self._core.get(Config.SECTION_CORE_STORAGEPATH) - if global_storage_path: - logger.warning("using obsoleted config format. Consider updating.") - - cloud = cloud_type(self.repo, cloud_config) - return cloud - def push(self, targets, jobs=None, remote=None, show_checksums=False): """Push data items in a cloud-agnostic way. diff --git a/dvc/remote/base.py b/dvc/remote/base.py index 0cfa3129b..ae6b584fe 100644 --- a/dvc/remote/base.py +++ b/dvc/remote/base.py @@ -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): diff --git a/dvc/remote/gs.py b/dvc/remote/gs.py index 95ce4c1c3..b171b9c4e 100644 --- a/dvc/remote/gs.py +++ b/dvc/remote/gs.py @@ -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 ( diff --git a/dvc/remote/local/__init__.py b/dvc/remote/local/__init__.py index 786e92ed3..127a4a3ba 100644 --- a/dvc/remote/local/__init__.py +++ b/dvc/remote/local/__init__.py @@ -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 diff --git a/dvc/remote/s3.py b/dvc/remote/s3.py index deb095170..d9adab21b 100644 --- a/dvc/remote/s3.py +++ b/dvc/remote/s3.py @@ -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( diff --git a/tests/func/test_data_cloud.py b/tests/func/test_data_cloud.py index d074feacf..a6092c61f 100644 --- a/tests/func/test_data_cloud.py +++ b/tests/func/test_data_cloud.py @@ -568,15 +568,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() @@ -610,18 +601,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() @@ -634,18 +613,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()