You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-29 07:41:16 +03:00
vdo: Use yaml.safe_load() instead of yaml.load() (#5632)
* vdo: Use yaml.safe_load() instead of yaml.load() yaml.load() without specifying a Loader= is deprecated and unsafe. For details, see https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation * Update changelogs/fragments/5632-vdo-Use-yaml-safe-load-instead-of-yaml-load.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@ -332,7 +332,7 @@ def inventory_vdos(module, vdocmd):
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Inventorying VDOs failed: %s" % vdostatusout, rc=rc, err=err)
|
||||
|
||||
vdostatusyaml = yaml.load(vdostatusout)
|
||||
vdostatusyaml = yaml.safe_load(vdostatusout)
|
||||
if vdostatusyaml is None:
|
||||
return vdolist
|
||||
|
||||
@ -548,7 +548,7 @@ def run_module():
|
||||
# Modify the current parameters of a VDO that exists.
|
||||
if desiredvdo in vdolist and state == 'present':
|
||||
rc, vdostatusoutput, err = module.run_command([vdocmd, "status"])
|
||||
vdostatusyaml = yaml.load(vdostatusoutput)
|
||||
vdostatusyaml = yaml.safe_load(vdostatusoutput)
|
||||
|
||||
# An empty dictionary to contain dictionaries of VDO statistics
|
||||
processedvdos = {}
|
||||
|
Reference in New Issue
Block a user