Skip to content
Snippets Groups Projects
Verified Commit 3517eb16 authored by Alexander Kreft's avatar Alexander Kreft
Browse files

ENH: add warning

parent 6ce9c09e
No related branches found
No related tags found
2 merge requests!33MAINT: change arguments of create_user,!29Revert "Revert "Merge branch 'f-validate-config' into 'dev'""
Pipeline #14801 passed
......@@ -24,6 +24,7 @@
import os
import yaml
import warnings
try:
optional_jsonschema_validate = None
from jsonschema import validate as optional_jsonschema_validate
......@@ -87,6 +88,10 @@ 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)
optional_jsonschema_validate(instance=valobj, schema=schema["schema-pycaosdb-ini"])
else:
warnings.warn("""
Warning: The validation could not be performed because `jsonschema` is not installed.
""")
def _read_config_files():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment