Skip to content

Commit 933b8cb

Browse files
committed
Fix network volume default, and XML indentation
1 parent 7f21f73 commit 933b8cb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

templates/vm.xml.j2

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@
4040
<driver name='qemu' type='{{ volume.format | default(libvirt_volume_default_format) }}'/>
4141
{% if volume.type | default(libvirt_volume_default_type) == 'file' %}
4242
<source file='{{ volume.file_path |default(libvirt_volume_default_images_path) }}/{{ volume.name}}'/>
43-
{% elif volume.type is defined and volume.type == 'network' %}
43+
{% elif volume.type | default(libvirt_volume_default_type) == 'network' %}
4444
{% if volume.auth.username is defined %}
45-
<auth username='{{ volume.auth.username }}'>
46-
<secret type='{{ volume.auth.type }}' {% if volume.auth.uuid is defined and volume.auth.uuid is not none %} uuid='{{ volume.auth.uuid }}' {% else %} usage='{{ volume.auth.usage }}' {% endif %}/>
47-
</auth>
45+
<auth username='{{ volume.auth.username }}'>
46+
<secret type='{{ volume.auth.type }}' {% if volume.auth.uuid is defined and volume.auth.uuid is not none %} uuid='{{ volume.auth.uuid }}' {% else %} usage='{{ volume.auth.usage }}' {% endif %}/>
47+
</auth>
4848
{% endif %} {# End volume.auth.username check #}
4949
{% if volume.source.name is defined %}
50-
<source protocol='{{ volume.source.protocol }}' name='{{ volume.source.name }}'>
50+
<source protocol='{{ volume.source.protocol }}' name='{{ volume.source.name }}'>
5151
{% for host in volume.source.hosts_list %}
52-
<host name='{{ host }}' {% if volume.source.port is defined and volume.source.port is not none %} port='{{ volume.source.port }}' {% endif %}/>
52+
<host name='{{ host }}' {% if volume.source.port is defined and volume.source.port is not none %} port='{{ volume.source.port }}' {% endif %}/>
5353
{% endfor %}
54-
</source>
54+
</source>
5555
{% endif %} {# End volume.source.name check #}
5656
{% else %} {# End elif volume.type is defined #}
5757
<source pool='{{ volume.pool }}' volume='{{ volume.name }}'/>

0 commit comments

Comments
 (0)