From 41152f10ddbd8681cdac44b408038a4f23ab02df Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 17 Oct 2017 16:12:59 -0400 Subject: schema: Log debug instead of warning when jsonschema is not available. When operating in expected path, cloud-init should avoid logging with warning. That causes 'WARNING' messages in /var/log/cloud-init.log. By default, warnings also go to the console. Since jsonschema is a optional dependency, and not present on xenial and zesty, cloud-init should not warn there. Also here: * Add a test to integration tests to assert that there are no warnings in /var/log/cloud-init.log. * Update one integration test that did show warning and the related documentation and examples. LP: #1724354 --- cloudinit/config/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/config/schema.py') diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py index bb291ff8..ca7d0d5b 100644 --- a/cloudinit/config/schema.py +++ b/cloudinit/config/schema.py @@ -74,7 +74,7 @@ def validate_cloudconfig_schema(config, schema, strict=False): try: from jsonschema import Draft4Validator, FormatChecker except ImportError: - logging.warning( + logging.debug( 'Ignoring schema validation. python-jsonschema is not present') return validator = Draft4Validator(schema, format_checker=FormatChecker()) -- cgit v1.2.3