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