summaryrefslogtreecommitdiff
path: root/heatclient
diff options
context:
space:
mode:
authorMehdi Abaakouk <sileht@sileht.net>2018-09-04 10:30:10 +0200
committerMehdi Abaakouk <sileht@sileht.net>2018-09-04 10:33:39 +0200
commit6ef3e8761edf66ec7aeb03bd9e1a820aa80f612a (patch)
tree5e4f4c37dce671bb1039596b99814ca007028c8c /heatclient
parentdcab4084c3151e8ec646223e4587a8ab09162edb (diff)
downloadpython-heatclient-6ef3e8761edf66ec7aeb03bd9e1a820aa80f612a.tar.gz
Don't change pyyaml behavior
When an application load heatclient, the default pyyaml behavior change. This ensures only heatclient use it's custom pyyaml stuffs. This currently breaks the telemetry gate if the tempest heat plugin is loaded with the telemetry. Change-Id: I5d7d1a1999e762f2285a0effc081252570f24de8
Diffstat (limited to 'heatclient')
-rw-r--r--heatclient/common/template_format.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/heatclient/common/template_format.py b/heatclient/common/template_format.py
index f73339f..fb275f6 100644
--- a/heatclient/common/template_format.py
+++ b/heatclient/common/template_format.py
@@ -16,14 +16,23 @@ import yaml
from heatclient._i18n import _
if hasattr(yaml, 'CSafeLoader'):
- yaml_loader = yaml.CSafeLoader
+ yaml_loader_base = yaml.CSafeLoader
else:
- yaml_loader = yaml.SafeLoader
+ yaml_loader_base = yaml.SafeLoader
if hasattr(yaml, 'CSafeDumper'):
- yaml_dumper = yaml.CSafeDumper
+ yaml_dumper_base = yaml.CSafeDumper
else:
- yaml_dumper = yaml.SafeDumper
+ yaml_dumper_base = yaml.SafeDumper
+
+
+# We create custom class to not overriden the default yaml behavior
+class yaml_loader(yaml_loader_base):
+ pass
+
+
+class yaml_dumper(yaml_dumper_base):
+ pass
def _construct_yaml_str(self, node):