From 33205273dc19f491337234b5fff8a0d63332bb58 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 27 Aug 2023 11:35:21 -0400 Subject: [PATCH] Fix missing YAML load --- client-cli/pvc/cli/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client-cli/pvc/cli/cli.py b/client-cli/pvc/cli/cli.py index 1e1d9aa4..8167b605 100644 --- a/client-cli/pvc/cli/cli.py +++ b/client-cli/pvc/cli/cli.py @@ -27,6 +27,8 @@ 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 yaml import SafeLoader as SafeYAMLLoader from pvc.cli.helpers import * from pvc.cli.waiters import * @@ -4510,7 +4512,7 @@ def cli_provisioner_userdata_add(name, filename): userdata = filename.read() filename.close() try: - yaml.load(userdata, Loader=yaml.SafeLoader) + yload(userdata, Loader=SafeYAMLLoader) except Exception as e: echo("Error: Userdata document is malformed") cleanup(False, e) @@ -4599,7 +4601,7 @@ def cli_provisioner_userdata_modify(name, filename, editor): filename.close() try: - yaml.load(userdata, Loader=yaml.SafeLoader) + yload(userdata, Loader=SafeYAMLLoader) except Exception as e: echo("Error: Userdata document is malformed") cleanup(False, e)