EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Data Handling
core
Commits
0c80f355
Commit
0c80f355
authored
3 years ago
by
Fabian Schindler
Browse files
Options
Downloads
Patches
Plain Diff
Adding way to handle fully qualified S3 URLs
parent
ea60f9de
No related branches found
Branches containing commit
Tags
release-2.0.13
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
registrar/source.py
+9
-0
9 additions, 0 deletions
registrar/source.py
with
9 additions
and
0 deletions
registrar/source.py
+
9
−
0
View file @
0c80f355
...
...
@@ -14,6 +14,7 @@ from fnmatch import fnmatch
import
logging
from
typing
import
TYPE_CHECKING
,
Optional
from
abc
import
ABC
,
abstractmethod
from
urllib.parse
import
urlparse
import
boto3
import
boto3.session
...
...
@@ -253,6 +254,14 @@ class S3Source(Source):
)
def
get_container_and_path
(
self
,
path
:
str
):
# try to see if we have a fully qualified S3 URL, in which case we will
# return bucket/path from there
parsed
=
urlparse
(
path
)
if
parsed
.
scheme
:
if
parsed
.
scheme
.
lower
()
!=
"
s3
"
:
raise
ValueError
(
"
invalid S3 URL {path}
"
)
return
(
parsed
.
netloc
,
parsed
.
path
[
1
:])
bucket
=
self
.
bucket_name
if
bucket
is
None
:
parts
=
(
path
[
1
:]
if
path
.
startswith
(
"
/
"
)
else
path
).
split
(
"
/
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment