Skip to content

Commit

Permalink
Merge pull request #2827 from Suor/bc-remnants
Browse files Browse the repository at this point in the history
dvc: remove unused config paths
  • Loading branch information
efiop committed Nov 21, 2019
2 parents 7bc7a57 + 0c2a475 commit f5c8d5d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 36 deletions.
30 changes: 4 additions & 26 deletions dvc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ class Config(object): # pylint: disable=too-many-instance-attributes
SECTION_CORE_CHECKSUM_JOBS: All(Coerce(int), Range(1)),
}

# backward compatibility
SECTION_AWS = "aws"
SECTION_AWS_STORAGEPATH = "storagepath"
# aws specific options
SECTION_AWS_CREDENTIALPATH = "credentialpath"
SECTION_AWS_ENDPOINT_URL = "endpointurl"
SECTION_AWS_LIST_OBJECTS = "listobjects"
Expand All @@ -172,34 +170,14 @@ class Config(object): # pylint: disable=too-many-instance-attributes
SECTION_AWS_USE_SSL = "use_ssl"
SECTION_AWS_SSE = "sse"
SECTION_AWS_ACL = "acl"
SECTION_AWS_SCHEMA = {
Required(SECTION_AWS_STORAGEPATH): str,
SECTION_AWS_REGION: str,
SECTION_AWS_PROFILE: str,
SECTION_AWS_CREDENTIALPATH: str,
SECTION_AWS_ENDPOINT_URL: str,
Optional(SECTION_AWS_LIST_OBJECTS, default=False): Bool,
Optional(SECTION_AWS_USE_SSL, default=True): Bool,
SECTION_AWS_SSE: str,
SECTION_AWS_ACL: str,
}

# backward compatibility
SECTION_GCP = "gcp"
SECTION_GCP_STORAGEPATH = SECTION_AWS_STORAGEPATH
# gcp specific options
SECTION_GCP_CREDENTIALPATH = SECTION_AWS_CREDENTIALPATH
SECTION_GCP_PROJECTNAME = "projectname"
SECTION_GCP_SCHEMA = {
Required(SECTION_GCP_STORAGEPATH): str,
SECTION_GCP_PROJECTNAME: str,
}

# backward compatibility
SECTION_LOCAL = "local"
SECTION_LOCAL_STORAGEPATH = SECTION_AWS_STORAGEPATH
SECTION_LOCAL_SCHEMA = {Required(SECTION_LOCAL_STORAGEPATH): str}

# azure specific option
SECTION_AZURE_CONNECTION_STRING = "connection_string"

# Alibabacloud oss options
SECTION_OSS_ACCESS_KEY_ID = "oss_key_id"
SECTION_OSS_ACCESS_KEY_SECRET = "oss_key_secret"
Expand Down
3 changes: 1 addition & 2 deletions dvc/remote/gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class RemoteGS(RemoteBASE):
def __init__(self, repo, config):
super(RemoteGS, self).__init__(repo, config)

storagepath = "gs://" + config.get(Config.SECTION_GCP_STORAGEPATH, "/")
url = config.get(Config.SECTION_REMOTE_URL, storagepath)
url = config.get(Config.SECTION_REMOTE_URL, "gs:///")
self.path_info = self.path_cls(url)

self.projectname = config.get(Config.SECTION_GCP_PROJECTNAME, None)
Expand Down
4 changes: 1 addition & 3 deletions dvc/remote/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ def __init__(self, repo, config):
# cache files are set to be read-only for everyone
self._file_mode = stat.S_IREAD | stat.S_IRGRP | stat.S_IROTH

# A clunky way to detect cache dir
storagepath = config.get(Config.SECTION_LOCAL_STORAGEPATH, None)
cache_dir = config.get(Config.SECTION_REMOTE_URL, storagepath)
cache_dir = config.get(Config.SECTION_REMOTE_URL)

if cache_dir is not None and not os.path.isabs(cache_dir):
cwd = config[Config.PRIVATE_CWD]
Expand Down
6 changes: 1 addition & 5 deletions dvc/remote/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ class RemoteS3(RemoteBASE):
def __init__(self, repo, config):
super(RemoteS3, self).__init__(repo, config)

storagepath = "s3://{}".format(
config.get(Config.SECTION_AWS_STORAGEPATH, "").lstrip("/")
)

url = config.get(Config.SECTION_REMOTE_URL, storagepath)
url = config.get(Config.SECTION_REMOTE_URL, "s3://")
self.path_info = self.path_cls(url)

self.region = config.get(Config.SECTION_AWS_REGION)
Expand Down

0 comments on commit f5c8d5d

Please sign in to comment.