pystachio
pystachio copied to clipboard
[Feature Request] Mustache Template iteration for List/Map
Would be nice to support iteration as documented in https://mustache.github.io/mustache.5.html
use case.
NAMERD_TEMPLATE = """---
admin:
port: {{thermos.ports[admin]}}
storage:
kind: io.l5d.zk
experimental: true
pathPrefix: /dtabs/{{profile.environment}}
zkAddrs:
{{#region.zk}}
- host: {{host}}
port: {{port}}
{{/region.zk}}
Where region is:
class Region(Struct):
zk = Required(List(Map(String, String)))
Region(
cluster='ZeroZero',
zk = [
{'host': 'zoo01', 'port': '2181'},
{'host': 'zoo02', 'port': '2181'},
{'host': 'zoo03', 'port': '2181'},
]
)
current result is:
aurora job create ZeroZero/nobody/devel/namerd namerd.aurora
Error loading configuration: #region.zk
this looks more likely an issue with how you are using the pystachio schema for representing what your mustache template accepts, than with pystachio itself? at least I cannot see from this bug report how this is the right place to report it (or how to repro this problem).