mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 15:28:26 +01:00
Merge pull request #847 from yustoris/feature/add-aws-remote-url
RFP: Add endpoint url config for AWS
This commit is contained in:
@@ -76,6 +76,7 @@ class Config(object):
|
||||
SECTION_AWS = 'aws'
|
||||
SECTION_AWS_STORAGEPATH = 'storagepath'
|
||||
SECTION_AWS_CREDENTIALPATH = 'credentialpath'
|
||||
SECTION_AWS_ENDPOINT_URL = 'endpointurl'
|
||||
SECTION_AWS_REGION = 'region'
|
||||
SECTION_AWS_PROFILE = 'profile'
|
||||
SECTION_AWS_SCHEMA = {
|
||||
@@ -83,6 +84,7 @@ class Config(object):
|
||||
schema.Optional(SECTION_AWS_REGION): str,
|
||||
schema.Optional(SECTION_AWS_PROFILE, default='default'): str,
|
||||
schema.Optional(SECTION_AWS_CREDENTIALPATH, default = ''): str,
|
||||
schema.Optional(SECTION_AWS_ENDPOINT_URL, default=None): str,
|
||||
}
|
||||
|
||||
# backward compatibility
|
||||
@@ -111,6 +113,7 @@ class Config(object):
|
||||
schema.Optional(SECTION_AWS_REGION): str,
|
||||
schema.Optional(SECTION_AWS_PROFILE, default='default'): str,
|
||||
schema.Optional(SECTION_AWS_CREDENTIALPATH, default = ''): str,
|
||||
schema.Optional(SECTION_AWS_ENDPOINT_URL, default=None): str,
|
||||
schema.Optional(SECTION_GCP_PROJECTNAME): str,
|
||||
schema.Optional(SECTION_CACHE_TYPE): SECTION_CACHE_TYPE_SCHEMA,
|
||||
schema.Optional(SECTION_REMOTE_USER): str,
|
||||
|
||||
+2
-1
@@ -45,6 +45,7 @@ class RemoteS3(RemoteBase):
|
||||
self.region = config.get(Config.SECTION_AWS_REGION, None)
|
||||
self.profile = config.get(Config.SECTION_AWS_PROFILE, None)
|
||||
self.credentialpath = config.get(Config.SECTION_AWS_CREDENTIALPATH, None)
|
||||
self.endpoint_url = config.get(Config.SECTION_AWS_ENDPOINT_URL, None)
|
||||
|
||||
@property
|
||||
def bucket(self):
|
||||
@@ -56,7 +57,7 @@ class RemoteS3(RemoteBase):
|
||||
|
||||
@property
|
||||
def s3(self):
|
||||
return boto3.resource('s3')
|
||||
return boto3.resource('s3', endpoint_url=self.endpoint_url)
|
||||
|
||||
def get_etag(self, bucket, key):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user