mesosphere / marathon-lb

Marathon-lb is a service discovery & load balancing tool for DC/OS
Apache License 2.0
449 stars 300 forks source link

Unable to use { in templates #180

Open jfindley opened 8 years ago

jfindley commented 8 years ago

If I want to include a template that uses a brace, I get various errors, depending on how it's done. If I write a simple {, I get a KeyError, as it attempts to parse it as a variable. If I use {{, as is normal for a python template, it actually renders the {{ to the final file.

To reproduce, include a HAPROXY_HTTPS_FRONTEND_HEAD template similar to the below:

frontend marathon_https_in
  bind *:443 ssl {sslCerts}
  mode http
  use_backend mesos if {{ ssl_fc_sni mesos.domain.com }}

I managed to hack together an awful fix by adding print(https_frontends) after line 279 of marathon_lb.py, which presumably does some sort of coercion to force the template to render properly? I don't know python well enough to venture more than vague guesses, unfortunately.

edude03 commented 8 years ago

I have the same issue, I'm unable to use %{+Q} in a template because of it.