1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Improved fix for #1074. Both None and '' transform to fqdn.

This commit is contained in:
Jeroen Geusebroek 2016-01-03 21:09:37 +01:00 committed by Matt Clay
parent 6fc533d663
commit 0b12f35f61

View file

@ -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: