Fix missing YAML load

This commit is contained in:
2023-08-27 11:35:21 -04:00
parent ce9eaaac8e
commit a92d328874

View File

@ -27,6 +27,7 @@ from os import environ, makedirs, path
from pkg_resources import get_distribution
from lxml.etree import fromstring, tostring
from re import sub
from yaml import load as yload
from pvc.cli.helpers import *
from pvc.cli.waiters import *
@ -4510,7 +4511,7 @@ def cli_provisioner_userdata_add(name, filename):
userdata = filename.read()
filename.close()
try:
yaml.load(userdata, Loader=yaml.SafeLoader)
yload(userdata, Loader=yaml.SafeLoader)
except Exception as e:
echo("Error: Userdata document is malformed")
cleanup(False, e)
@ -4599,7 +4600,7 @@ def cli_provisioner_userdata_modify(name, filename, editor):
filename.close()
try:
yaml.load(userdata, Loader=yaml.SafeLoader)
yload(userdata, Loader=yaml.SafeLoader)
except Exception as e:
echo("Error: Userdata document is malformed")
cleanup(False, e)