Added ordered hashes.
This commit is contained in:
parent
243ab902ab
commit
da070c862b
@ -17,10 +17,14 @@
|
|||||||
{{- '}\n' -}}
|
{{- '}\n' -}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
|
{%- if recurse > 0 -%}
|
||||||
{{- '{\n' -}}
|
{{- '{\n' -}}
|
||||||
|
{%- endif -%}
|
||||||
{%- for item in data -%}
|
{%- for item in data -%}
|
||||||
{{- keepalived_config(item) -}}
|
{{- keepalived_config(item) -}}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{%- if recurse > 0 -%}
|
||||||
{{- '}\n' -}}
|
{{- '}\n' -}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
@ -54,5 +54,10 @@ class TestKeepalivedConfiguration(unittest.TestCase):
|
|||||||
result = 'friends {\nbarney rubble\nbetty rubble\nfred flintstone\nwilma flintstone\n}\n'
|
result = 'friends {\nbarney rubble\nbetty rubble\nfred flintstone\nwilma flintstone\n}\n'
|
||||||
self.renderTest(testdata, result)
|
self.renderTest(testdata, result)
|
||||||
|
|
||||||
|
def test_ordered_hashes(self):
|
||||||
|
testdata = [{'fred': 'flintstone'}, {'wilma': 'flintstone'}, {'barney': 'rubble'}, {'betty': 'rubble'}]
|
||||||
|
result = 'fred flintstone\nwilma flintstone\nbarney rubble\nbetty rubble\n'
|
||||||
|
self.renderTest(testdata, result)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user