Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
49b11ff2
Verified
Commit
49b11ff2
authored
3 years ago
by
Alexander Kreft
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: fix optional package
parent
c8553d1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!33
MAINT: change arguments of create_user
,
!29
Revert "Revert "Merge branch 'f-validate-config' into 'dev'""
Pipeline
#14528
passed
3 years ago
Stage: code_style
Stage: linting
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/configuration.py
+9
-4
9 additions, 4 deletions
src/caosdb/configuration.py
with
9 additions
and
4 deletions
src/caosdb/configuration.py
+
9
−
4
View file @
49b11ff2
...
...
@@ -24,7 +24,11 @@
import
os
import
yaml
from
jsonschema
import
validate
try
:
optional_jsonschema
=
None
from
jsonschema
import
validate
as
optional_jsonschema_validate
except
ImportError
:
pass
try
:
# python2
...
...
@@ -79,9 +83,10 @@ def config_to_yaml(config):
def
validate_yaml_schema
(
valobj
):
with
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
schema-pycaosdb-ini.yml
"
))
as
f
:
schema
=
yaml
.
load
(
f
,
Loader
=
yaml
.
SafeLoader
)
validate
(
instance
=
valobj
,
schema
=
schema
[
"
schema-pycaosdb-ini
"
])
if
optional_jsonschema_validate
:
with
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
schema-pycaosdb-ini.yml
"
))
as
f
:
schema
=
yaml
.
load
(
f
,
Loader
=
yaml
.
SafeLoader
)
optional_jsonschema_validate
(
instance
=
valobj
,
schema
=
schema
[
"
schema-pycaosdb-ini
"
])
def
_read_config_files
():
...
...
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