Handle cyaml Marks
The Mark class provided by libyaml (aka cyaml from PyYAML) has
some interesting characteristics. The data in it may not be valid
once parsing is completed. It also lacks the snippets provided
by the native python parser.
To deal with this, create our own ZuulMark class which is used to
record the location of configuration objects in the case of
configuration errors. Initialize it from the start and end marks
that pyyaml gives us. And since we lack the snippet, copy the
raw text for each of our configuration objects and use that in
place of the pretty-printed data we used to include in the error.
This will at least show the user the actual erroneous content,
along with file, line, and column information.
Change-Id: I669c1883cac7994c759eaae0d0b23cc6924d2915
2 files changed