diff options
Diffstat (limited to 'lava_scheduler_app/api/__init__.py')
-rw-r--r-- | lava_scheduler_app/api/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lava_scheduler_app/api/__init__.py b/lava_scheduler_app/api/__init__.py index c74e713b7..2c8c01a4f 100644 --- a/lava_scheduler_app/api/__init__.py +++ b/lava_scheduler_app/api/__init__.py @@ -223,7 +223,7 @@ class SchedulerAPI(ExposedAPI): """ try: # YAML can parse JSON as YAML, JSON cannot parse YAML at all - yaml_data = yaml.load(yaml_string) + yaml_data = yaml.safe_load(yaml_string) except yaml.YAMLError as exc: raise xmlrpc.client.Fault(400, "Decoding job submission failed: %s." % exc) try: @@ -1098,7 +1098,7 @@ class SchedulerAPI(ExposedAPI): job_ctx = None if context is not None: try: - job_ctx = yaml.load(context) + job_ctx = yaml.safe_load(context) except yaml.YAMLError as exc: raise xmlrpc.client.Fault( 400, @@ -1111,7 +1111,7 @@ class SchedulerAPI(ExposedAPI): config = device.load_configuration(job_ctx=job_ctx, output_format="yaml") # validate against the device schema - validate_device(yaml.load(config)) + validate_device(yaml.safe_load(config)) return xmlrpc.client.Binary(config.encode('UTF-8')) @@ -1259,7 +1259,7 @@ class SchedulerAPI(ExposedAPI): continue try: # validate against the device schema - validate_device(yaml.load(config)) + validate_device(yaml.safe_load(config)) except SubmissionException as exc: results[key] = {'Invalid': exc} continue |