From e7f97d118ba65f9f010ebd4ec9a46c77add76307 Mon Sep 17 00:00:00 2001 From: akrzos Date: Wed, 17 Jan 2018 12:56:14 -0500 Subject: [PATCH] Issue with loading yaml files after requirements change Several dependent requirements have changed underneath Browbeat changing how loaded schema file is passed into pykwalify in which strings are treated as unicode vs a string. This causes pykwalify to throw up a stacktrace. This has pykwalify load the yaml schema file instead thus avoiding the issue. Change-Id: Iabe2162298f272fd0f2aa5cf365b11ab1f0e8c98 --- browbeat/config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/browbeat/config.py b/browbeat/config.py index a7e9343bc..dfc940ce2 100644 --- a/browbeat/config.py +++ b/browbeat/config.py @@ -47,9 +47,8 @@ def _validate_yaml(schema, config): :param schema: The schema to validate with (browbeat, perfkit, rally...) :param config: Loaded yaml to validate """ - with open("{}/{}.yml".format(conf_schema_path, schema), "r") as schema_file: - schema = yaml.safe_load(schema_file) - check = pykwalify_core.Core(source_data=config, schema_data=schema) + check = pykwalify_core.Core( + source_data=config, schema_files=["{}/{}.yml".format(conf_schema_path, schema)]) try: check.validate(raise_exception=True) except pykwalify_errors.SchemaError as e: