Skip to content

Commit

Permalink
fix(jinja): fix generated iscsi.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Oct 5, 2019
1 parent 1645c53 commit 1def94b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions iscsi/initiator/config/files/default/iscsi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{%- if value is mapping %}
{{shift}}{{ key }} { # nickname
{{ readconf(value, spaces|int+4) }}
}
{%- elif value is string or value is number %}
{{shift}}{{ key }} = {{"'" if value is not string else ''}}{{ value }}{{"'" if value is not string else ''}}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions iscsi/initiator/config/files/default/open-iscsi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

{%- macro openiscsi(key, value, spaces=0) -%}
{%- set shift = spaces * ' ' -%}
{{shift}}{{ key }} = {{"'" if value is not string else ''}}{{ value }}{{"'" if value is not string else ''}}
{%- endmacro -%}
{{shift}}{{ key }} = {{ value ~ '\n' if value is string else '"' ~ value ~ '"\n' }}
{%- endmacro %}

{{ readconf(data, 0) }}

Expand Down

0 comments on commit 1def94b

Please sign in to comment.