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

Conversation

holmanb
Copy link
Member

@holmanb holmanb commented Nov 21, 2023

Proposed Commit Message

Use commit message

@holmanb holmanb changed the title Holmanb/actually validate or tell user we cannot Actually validate or tell user we cannot Nov 21, 2023
cloudconfig, schema, strict=True, log_deprecations=False
)
):
print("Cannot validate config, jsonschema dependency missing")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this message include Skipping schema validation somehow and we should return False just like our network-config skip above as this function returns False when schema validation is not performed.

Suggested change
print("Cannot validate config, jsonschema dependency missing")
print("Cannot validate config, jsonschema dependency missing")
return False

Previously users that didn't have the python jsonschema dependency
installed would "succeed" to validate a user configuration. Fix it.
@holmanb holmanb force-pushed the holmanb/actually-validate-or-tell-user-we-cannot branch from 11a7371 to 167c8a4 Compare November 21, 2023 18:24
@holmanb holmanb requested a review from blackboxsw November 21, 2023 18:28
@holmanb
Copy link
Member Author

holmanb commented Nov 21, 2023

@blackboxsw Thanks, updated

Co-authored-by: Chad Smith <chad.smith@canonical.com>
@holmanb holmanb requested a review from blackboxsw November 21, 2023 18:52
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thx from adding that whitespace. squash as you see fit. I'm not concerned with unittests/integration tests here as most packaging should be expressing this python3-jsonschema dependency. And we also have debug logs in /var/log/cloud-init.log that' will announce that json schema validation is skipped

@holmanb holmanb merged commit 424bacc into canonical:main Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants