summaryrefslogtreecommitdiffstats
path: root/roles/lib_utils/library
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-02-16 15:44:26 -0500
committerKenny Woodson <kwoodson@redhat.com>2017-02-16 15:46:14 -0500
commitd4db2dd279916c2a1f73c236deed444fed5cc740 (patch)
tree9e2185c969136790788f8ef21435df480719dcf3 /roles/lib_utils/library
parent42af186c6f961a9a7cd76abc4ac423d9141bded2 (diff)
downloadopenshift-d4db2dd279916c2a1f73c236deed444fed5cc740.tar.gz
openshift-d4db2dd279916c2a1f73c236deed444fed5cc740.tar.bz2
openshift-d4db2dd279916c2a1f73c236deed444fed5cc740.tar.xz
openshift-d4db2dd279916c2a1f73c236deed444fed5cc740.zip
Fixed tests for pyyaml vs ruamel. Added import logic. Fixed safe load.
Diffstat (limited to 'roles/lib_utils/library')
-rw-r--r--roles/lib_utils/library/yedit.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/lib_utils/library/yedit.py b/roles/lib_utils/library/yedit.py
index 29475d603..7f71e6cbc 100644
--- a/roles/lib_utils/library/yedit.py
+++ b/roles/lib_utils/library/yedit.py
@@ -388,7 +388,7 @@ class Yedit(object):
if hasattr(yaml, 'RoundTripDumper'):
Yedit._write(self.filename, yaml.dump(self.yaml_dict, Dumper=yaml.RoundTripDumper))
else:
- Yedit._write(self.filename, yaml.dump(self.yaml_dict, default_flow_style=False))
+ Yedit._write(self.filename, yaml.safe_dump(self.yaml_dict, default_flow_style=False))
return (True, self.yaml_dict)
@@ -431,7 +431,7 @@ class Yedit(object):
if hasattr(yaml, 'RoundTripLoader'):
self.yaml_dict = yaml.load(contents, yaml.RoundTripLoader)
else:
- self.yaml_dict = yaml.load(contents)
+ self.yaml_dict = yaml.safe_load(contents)
# pylint: disable=no-member
if hasattr(self.yaml_dict, 'fa'):
self.yaml_dict.fa.set_block_style()