Skip to content

Commit

Permalink
Check that 'cinder_nfs_client' is defined
Browse files Browse the repository at this point in the history
In order to avoid undefined error

Change-Id: Ie869bf49b138ca890469cd47a7249e9b166caac4
  • Loading branch information
dissnn committed May 11, 2017
1 parent d1e18b9 commit 8c4a79d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion templates/nfs_shares.j2
@@ -1,5 +1,10 @@
# {{ ansible_managed }}
{% set shares_exports = item.value.shares | default([]) | union(cinder_nfs_client.shares | default([])) %}
{% if cinder_nfs_client is defined %}
{% set shares_exports = item.value.shares | default([]) | union(cinder_nfs_client.shares | default([])) %}
{% else %}
{% set shares_exports = item.value.shares | default([]) %}
{% endif %}

{% for share in shares_exports %}
{{ share.ip }}:{{ share.share }}
{% endfor %}

0 comments on commit 8c4a79d

Please sign in to comment.