summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/openshift_ops.py5
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
index da8225a..1835d9c 100644
--- a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
@@ -567,7 +567,7 @@ def oc_get_yaml(ocp_node, rtype, name=None, raise_on_error=True):
cmd.append(name)
out = command.cmd_run(
cmd, hostname=ocp_node, raise_on_error=raise_on_error)
- return yaml.load(out) if out else {}
+ return yaml.load(out, Loader=yaml.FullLoader) if out else {}
def oc_get_pvc(ocp_node, name):
@@ -1460,7 +1460,8 @@ def get_events(hostname,
cmd = "oc get events -o yaml"
if openshift_version.get_openshift_version() >= '3.9':
cmd += " --field-selector %s" % ",".join(field_selector or "''")
- objects = yaml.load(command.cmd_run(cmd, hostname=hostname))['items']
+ get_objects = command.cmd_run(cmd, hostname=hostname)
+ objects = yaml.load(get_objects, Loader=yaml.FullLoader)['items']
if openshift_version.get_openshift_version() >= '3.9':
return objects
diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py b/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py
index ea37ee3..5005a91 100644
--- a/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py
+++ b/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py
@@ -75,7 +75,7 @@ def enable_pvc_resize(master_node):
raise ExecutionError(err_msg)
with conn.builtin.open(MASTER_CONFIG_FILEPATH, 'r') as f:
- data = yaml.load(f)
+ data = yaml.load(f, Loader=yaml.FullLoader)
dict_add = data['admissionConfig']['pluginConfig']
if "PersistentVolumeClaimResize" in dict_add:
g.log.info("master-config.yaml file is already edited")