Correct YAML load warning
The use of `yaml.load` without Loader is deprecated and considered unsafe. The warning notice: /opt/stack/python-tackerclient/tackerclient/tacker/v1_0/nfvo/vim.py: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. config_param = yaml.load(config_yaml) This change adds (Loader=yaml.SafeLoader) to remove the warning. Change-Id: Idc77d855b41801777d57cfe92d1c448b6e72feaa
This commit is contained in:
@@ -230,7 +230,8 @@ class UpdateVIM(command.ShowOne):
|
|||||||
with open(parsed_args.config_file) as f:
|
with open(parsed_args.config_file) as f:
|
||||||
config_yaml = f.read()
|
config_yaml = f.read()
|
||||||
try:
|
try:
|
||||||
config_param = yaml.load(config_yaml)
|
config_param = yaml.load(config_yaml,
|
||||||
|
Loader=yaml.SafeLoader)
|
||||||
except yaml.YAMLError as e:
|
except yaml.YAMLError as e:
|
||||||
raise exceptions.InvalidInput(reason=e)
|
raise exceptions.InvalidInput(reason=e)
|
||||||
vim_obj = body[_VIM]
|
vim_obj = body[_VIM]
|
||||||
|
@@ -117,7 +117,8 @@ class UpdateVIM(tackerV10.UpdateCommand):
|
|||||||
with open(parsed_args.config_file) as f:
|
with open(parsed_args.config_file) as f:
|
||||||
config_yaml = f.read()
|
config_yaml = f.read()
|
||||||
try:
|
try:
|
||||||
config_param = yaml.load(config_yaml)
|
config_param = yaml.load(config_yaml,
|
||||||
|
Loader=yaml.SafeLoader)
|
||||||
except yaml.YAMLError as e:
|
except yaml.YAMLError as e:
|
||||||
raise exceptions.InvalidInput(reason=e)
|
raise exceptions.InvalidInput(reason=e)
|
||||||
vim_obj = body[self.resource]
|
vim_obj = body[self.resource]
|
||||||
|
Reference in New Issue
Block a user