[master] dec0da3 Don't abort on unknown keywords by default
Federico G. Schwindt
fgsch at lodoss.net
Fri Feb 12 12:02:03 CET 2016
commit dec0da32e4415f095b4f1754571af8f7f31dc8fc
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Fri Feb 12 10:48:18 2016 +0000
Don't abort on unknown keywords by default
Just warn unless --strict is used. This allows to use the same .vcc in
4.0 and 4.1.
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 7662557..bb29bd4 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -791,7 +791,15 @@ class FileSection(object):
o = parse_func(self, pobj=vx[1].nam)
vx[1].add_method(o)
else:
- raise FormatError("Unknown keyword: %s" % t.str, "")
+ if opts.strict:
+ raise FormatError("Unknown keyword: %s" %
+ t.str, "")
+ else:
+ print("WARNING: Unknown keyword: %s:" %
+ t.str, file=sys.stderr)
+ o = None
+ while len(self.tl) > 0:
+ self.get_token()
assert len(self.tl) == 0
if o is None and len(self.l) > 0:
More information about the varnish-commit
mailing list