Merge "Replace yaml.load() with yaml.safe_load()"
This commit is contained in:
commit
f735864b78
@ -237,7 +237,7 @@ for i in $(find elements -type f -name '*.yaml'); do
|
||||
import yaml
|
||||
import sys
|
||||
try:
|
||||
objs = yaml.load(open('$i'))
|
||||
objs = yaml.safe_load(open('$i'))
|
||||
except yaml.parser.ParserError:
|
||||
sys.exit(1)
|
||||
"
|
||||
|
@ -59,7 +59,7 @@ def collect_data(data, filename, element_name):
|
||||
try:
|
||||
objs = json.load(open(filename))
|
||||
except ValueError:
|
||||
objs = yaml.load(open(filename))
|
||||
objs = yaml.safe_load(open(filename))
|
||||
for pkg_name, params in objs.items():
|
||||
if not params:
|
||||
params = {}
|
||||
|
@ -24,7 +24,7 @@ def load_service_mapping(filepath="/usr/share/svc-map/services"):
|
||||
if not os.path.isfile(filepath):
|
||||
return {}
|
||||
with open(filepath, 'r') as data_file:
|
||||
return yaml.load(data_file.read())
|
||||
return yaml.safe_load(data_file.read())
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -70,7 +70,7 @@ def main():
|
||||
data_path = os.path.join(element_path, element, "svc-map")
|
||||
if os.path.exists(data_path):
|
||||
with open(data_path, 'r') as dataFile:
|
||||
data = yaml.load(dataFile.read())
|
||||
data = yaml.safe_load(dataFile.read())
|
||||
try:
|
||||
service_names = merge_data(
|
||||
data,
|
||||
|
Loading…
Reference in New Issue
Block a user