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.
@@ -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):
