Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate yaml for haproxy charm
#!/usr/bin/env python
import json
service = [
'service_name': 'demo',
'service_options': ['mode http', 'balance leastconn', 'option httpchk GET / HTTP/1.0'],
'server_options': ['maxconn 100'],
'servers': [
services = json.dumps(foo)
services = services.replace('"', "'")
print "relation-set \"services=%s\"" % services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.