imjoey / pyhaproxy

Python library to parse haproxy configurations
MIT License
54 stars 21 forks source link

error when parsing the configuration file generated by render.dumps_to() #2

Closed imjoey closed 8 years ago

imjoey commented 8 years ago

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"
imjoey commented 8 years ago

closed. see commit 3c792b3