Merge "Replace yaml.load() with yaml.safe_load()"
This commit is contained in:
commit
f94517bc7c
@ -16,7 +16,7 @@ import sys
|
||||
from pykwalify import core as pykwalify_core
|
||||
from pykwalify import errors as pykwalify_errors
|
||||
stream = open(sys.argv[1], 'r')
|
||||
schema = yaml.load(stream)
|
||||
schema = yaml.safe_load(stream)
|
||||
check = pykwalify_core.Core(sys.argv[2], schema_data=schema)
|
||||
try:
|
||||
check.validate(raise_exception=True)
|
||||
|
@ -244,7 +244,7 @@ class Shaker(WorkloadBase.WorkloadBase):
|
||||
|
||||
def set_scenario(self, scenario, fname, default_time):
|
||||
stream = open(fname, 'r')
|
||||
data = yaml.load(stream)
|
||||
data = yaml.safe_load(stream)
|
||||
stream.close()
|
||||
default_density = 1
|
||||
default_compute = 1
|
||||
|
@ -93,7 +93,7 @@ class Tools(object):
|
||||
self.logger.error(
|
||||
"Configuration file {} passed is missing".format(path))
|
||||
exit(1)
|
||||
config = yaml.load(stream)
|
||||
config = yaml.safe_load(stream)
|
||||
stream.close()
|
||||
self.config = config
|
||||
if validate:
|
||||
@ -104,7 +104,7 @@ class Tools(object):
|
||||
self.logger.info(
|
||||
"Validating the configuration file passed by the user")
|
||||
stream = open("lib/validate.yaml", 'r')
|
||||
schema = yaml.load(stream)
|
||||
schema = yaml.safe_load(stream)
|
||||
check = pykwalify_core.Core(
|
||||
source_data=self.config, schema_data=schema)
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user