EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
ESA
PRISM
VS
Commits
441ad3ed
Commit
441ad3ed
authored
3 years ago
by
Fabian Schindler
Browse files
Options
Downloads
Patches
Plain Diff
Allow case where no mapping is found for a product
parent
fdf46046
No related branches found
No related tags found
1 merge request
!82
Staging to master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/registrar/backend.py
+13
-3
13 additions, 3 deletions
core/registrar/backend.py
with
13 additions
and
3 deletions
core/registrar/backend.py
+
13
−
3
View file @
441ad3ed
...
...
@@ -257,13 +257,22 @@ class EOxServerBackend(Backend):
stac_item
=
read_json
(
source
,
item
.
path
)
if
not
item
.
product_type
:
if
not
mapping
:
product_type
,
_
=
create_product_type_from_stac_item
(
stac_item
,
product_type_name
=
item
.
product_type
,
ignore_existing
=
True
,
coverage_mapping
=
None
)
elif
not
item
.
product_type
:
product_type
,
_
=
create_product_type_from_stac_item
(
stac_item
,
product_type_name
=
None
,
ignore_existing
=
True
,
coverage_mapping
=
mapping
.
get
(
'
coverages
'
,
{})
)
else
:
try
:
product_type
=
mapping
[
'
product_type_name
'
]
...
...
@@ -297,11 +306,12 @@ class EOxServerBackend(Backend):
)
# get the mapping for this particular item
mapping
=
{}
try
:
type_mapping
=
self
.
mapping
[
item
.
product_type
]
mapping
=
type_mapping
.
get
(
item
.
product_level
)
or
type_mapping
.
get
(
None
)
or
{}
except
KeyError
:
raise
RegistrationError
(
f
'
Could not find mapping for
{
item
.
product_type
}
in configuration
'
)
mapping
=
type_mapping
.
get
(
item
.
product_level
)
or
type_mapping
.
get
(
None
)
or
{}
pass
# branch here for STAC Item registration, as a product type can be dynamically generated
if
item
.
scheme
==
'
stac-item
'
:
...
...
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