From 0b12f35f61741cf780f03d1338686b8cf6ec0d2c Mon Sep 17 00:00:00 2001 From: Jeroen Geusebroek Date: Sun, 3 Jan 2016 21:09:37 +0100 Subject: [PATCH] Improved fix for #1074. Both None and '' transform to fqdn. --- lib/ansible/modules/extras/system/gluster_volume.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/system/gluster_volume.py b/lib/ansible/modules/extras/system/gluster_volume.py index ea74c25f166..10d50c34370 100644 --- a/lib/ansible/modules/extras/system/gluster_volume.py +++ b/lib/ansible/modules/extras/system/gluster_volume.py @@ -350,10 +350,10 @@ def main(): # Clean up if last element is empty. Consider that yml can look like this: # cluster="{% for host in groups['glusterfs'] %}{{ hostvars[host]['private_ip'] }},{% endfor %}" - if cluster != None and cluster[-1] == '': + if cluster != None and len(cluster) > 1 and cluster[-1] == '': cluster = cluster[0:-1] - if cluster == None: + if cluster == None or cluster[0] == '': cluster = [myhostname] if brick_paths != None and "," in brick_paths: