From 082789b01222a1bcd89cb5ec6d8470955779c48b Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 13 May 2016 10:20:46 -0700 Subject: [PATCH] Back out onlyaml rewrite to another branch --- .../all/vendor-config-onl/src/python/onl/YamlUtils.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/YamlUtils.py b/packages/base/all/vendor-config-onl/src/python/onl/YamlUtils.py index 44822148..4381f799 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/YamlUtils.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/YamlUtils.py @@ -3,12 +3,6 @@ """ import yaml -try: - import onlyaml - def load(stream): - return yaml.load(stream, Loader=onlyaml.Loader) -except ImportError: - load = yaml.load def merge(p1, p2): """Merge two YAML files. @@ -34,7 +28,7 @@ def merge(p1, p2): buf2 = fd.read() # read p1 as-is, make sure it looks like a 'default' YAML - c1 = load(buf1) + c1 = yaml.load(buf1) k1 = list(c1.keys()) if k1 != ['default']: raise ValueError("%s: invalid top-level keys for default mapping: %s" @@ -44,7 +38,7 @@ def merge(p1, p2): lines = buf2.splitlines(False) lines = [x for x in lines if x != '---'] buf3 = buf1 + "\n" + "\n".join(lines) - c2 = load(buf3) + c2 = yaml.load(buf3) c2.pop('default', None) k2 = list(c2.keys())