cherrypy.request.headers.pop("Content-File-MD5", None)
elif "application/yaml" in cherrypy.request.headers["Content-Type"]:
error_text = "Invalid yaml format "
- indata = yaml.load(cherrypy.request.body)
+ indata = yaml.load(cherrypy.request.body, Loader=yaml.SafeLoader)
cherrypy.request.headers.pop("Content-File-MD5", None)
elif "application/binary" in cherrypy.request.headers["Content-Type"] or \
"application/gzip" in cherrypy.request.headers["Content-Type"] or \
# "Only 'Content-Type' of type 'application/json' or
# 'application/yaml' for input format are available")
error_text = "Invalid yaml format "
- indata = yaml.load(cherrypy.request.body)
+ indata = yaml.load(cherrypy.request.body, Loader=yaml.SafeLoader)
cherrypy.request.headers.pop("Content-File-MD5", None)
else:
error_text = "Invalid yaml format "
- indata = yaml.load(cherrypy.request.body)
+ indata = yaml.load(cherrypy.request.body, Loader=yaml.SafeLoader)
cherrypy.request.headers.pop("Content-File-MD5", None)
if not indata:
indata = {}
kwargs[k] = None
elif format_yaml:
try:
- kwargs[k] = yaml.load(v)
+ kwargs[k] = yaml.load(v, Loader=yaml.SafeLoader)
except Exception:
pass
elif k.endswith(".gt") or k.endswith(".lt") or k.endswith(".gte") or k.endswith(".lte"):
v[index] = None
elif format_yaml:
try:
- v[index] = yaml.load(v[index])
+ v[index] = yaml.load(v[index], Loader=yaml.SafeLoader)
except Exception:
pass
return_text = "<html><pre>{} ->\n".format(main_topic)
try:
if cherrypy.request.method == 'POST':
- to_send = yaml.load(cherrypy.request.body)
+ to_send = yaml.load(cherrypy.request.body, Loader=yaml.SafeLoader)
for k, v in to_send.items():
self.engine.msg.write(main_topic, k, v)
return_text += " {}: {}\n".format(k, v)
elif cherrypy.request.method == 'GET':
for k, v in kwargs.items():
- self.engine.msg.write(main_topic, k, yaml.load(v))
- return_text += " {}: {}\n".format(k, yaml.load(v))
+ self.engine.msg.write(main_topic, k, yaml.load(v), Loader=yaml.SafeLoader)
+ return_text += " {}: {}\n".format(k, yaml.load(v), Loader=yaml.SafeLoader)
except Exception as e:
return_text += "Error: " + str(e)
return_text += "</pre></html>\n"
ns_data.update(self.ns_params)
if test_params and test_params.get("ns-config"):
if isinstance(test_params["ns-config"], str):
- ns_data.update(yaml.load(test_params["ns-config"]))
+ ns_data.update(yaml.load(test_params["ns-config"]), Loader=yaml.Loader)
else:
ns_data.update(test_params["ns-config"])
self.instantiate(engine, ns_data)
parameter:
"$[0]":
default-value: "<touch_filename2>"
- """)
+ """,
+ Loader=yaml.Loader)
}
self.ns_params = {
"additionalParamsForVnf": [
"vimAccountId": self.vim_id}
if test_params and test_params.get("ns-config"):
if isinstance(test_params["ns-config"], str):
- ns_data.update(yaml.load(test_params["ns-config"]))
+ ns_data.update(yaml.load(test_params["ns-config"]), Loader=yaml.Loader)
else:
ns_data.update(test_params["ns-config"])