Skip to content

Commit

Permalink
Fixed trailing comma bug
Browse files Browse the repository at this point in the history
Depending on the options specified, there could be a trailing comma which is invalid JSON and prevented consul from starting. Lame but easy solution was to make a required configuration be the last one and never have a trailing comma and made sure all other configs do end in a comma.
  • Loading branch information
rcostanzo committed Oct 24, 2014
1 parent ae9920d commit 36e29a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/consul.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"advertise_addr": "{{ consul_advertise_address }}",
{% endif %}
"datacenter": "{{ consul_datacenter }}",
"rejoin_after_leave": {{ "true" if consul_rejoin_after_leave else "false" }},
{% if consul_is_server and consul_bootstrap is defined %}
"bootstrap": {{ "true" if consul_bootstrap else "false" }}
"bootstrap": {{ "true" if consul_bootstrap else "false" }},
{% endif %}
{% if consul_is_server and consul_bootstrap_expect is defined %}
"bootstrap_expect": {{ consul_bootstrap_expect }},
Expand All @@ -30,6 +29,7 @@
"encrypt": "{{ consul_encrypt_key }}",
{% endif %}
{% if consul_watches is defined %}
"watches": {{ consul_watches|to_nice_json }}
"watches": {{ consul_watches|to_nice_json }},
{% endif %}
"rejoin_after_leave": {{ "true" if consul_rejoin_after_leave else "false" }}
}

0 comments on commit 36e29a3

Please sign in to comment.