From 6ef3e8761edf66ec7aeb03bd9e1a820aa80f612a Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Tue, 4 Sep 2018 10:30:10 +0200 Subject: 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 --- heatclient/common/template_format.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'heatclient') 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): -- cgit v1.2.1