I use render.dumps_to() function to write configurations to a file successfully, e.g: render_conf.cfg, but when calling parser.parse(render_conf.cfg), there has some exceptions as blow:
File "/usr/lib/python2.6/site-packages/pyhaproxy-0.1.6-py2.6.egg/pyhaproxy/parse.py", line 32, in build_configuration
self.pegtree = pegnode.parse(self.filestring)
File "/usr/lib/python2.6/site-packages/pyhaproxy-0.1.6-py2.6.egg/pyhaproxy/pegnode.py", line 3075, in parse
return parser.parse()
File "/usr/lib/python2.6/site-packages/pyhaproxy-0.1.6-py2.6.egg/pyhaproxy/pegnode.py", line 3059, in parse
raise ParseError(format_error(self._input, self._failure, self._expected))
pyhaproxy.pegnode.ParseError: Line 230: expected [ \t], "server", "option", "bind", "acl", "use_backend", "default_backend", "group", "user", "defaults", "global", "userlist", "listen", "frontend", "backend", "errorfile", "timeout", [a-z0-9\-\_\.], "#", [\n], "global", "defaults", "userlist", "listen", "frontend", "backend"
I use render.dumps_to() function to write configurations to a file successfully, e.g: render_conf.cfg, but when calling parser.parse(render_conf.cfg), there has some exceptions as blow: