Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually validate or tell user we cannot #4616

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cloudinit/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ def validate_cloudconfig_schema(
"see the schema errors."
)
LOG.warning(details)
return True


class _Annotator:
Expand Down Expand Up @@ -937,9 +938,14 @@ def validate_cloudconfig_file(
)
return False
try:
validate_cloudconfig_schema(
if not validate_cloudconfig_schema(
cloudconfig, schema, strict=True, log_deprecations=False
)
):
print(
f"Skipping {schema_type} schema validation."
" Jsonschema dependency missing."
)
return False
except SchemaValidationError as e:
if e.has_errors():
errors += e.schema_errors
Expand Down