# Error using wait\_for exclude\_hosts option

**URL:** <https://forum.ansible.com/t/error-using-wait-for-exclude-hosts-option/16397>\
**Category:** Ansible Project\
**Created:** [October 1, 2014, 9:18pm UTC](https://forum.ansible.com/t/error-using-wait-for-exclude-hosts-option/16397 "2014-10-01T21:18:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Formsma](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@Kevin\_Formsma](https://forum.ansible.com/u/Kevin_Formsma)\
**Post date:** [October 1, 2014, 9:18pm UTC](https://forum.ansible.com/t/error-using-wait-for-exclude-hosts-option/16397/1 "2014-10-01T21:18:47Z")

</div>

I’m trying to use the new exclude\_hosts option as part of the drained state on the wait\_for module ([https://github.com/ansible/ansible/pull/7260](https://github.com/ansible/ansible/pull/7260)). I’m using the latest source from git.

However I’m getting the following error:

`Traceback (most recent call last): File "/home/monk/.ansible/tmp/ansible-tmp-1412198038.01-173699330634982/wait_for", line 1967, in <module> main() File "/home/monk/.ansible/tmp/ansible-tmp-1412198038.01-173699330634982/wait_for", line 326, in main exclude_hosts = params['exclude_hosts'].split(',') AttributeError: 'list' object has no attribute 'split'`

My task looks like:

`wait_for: host={{ ansible_hostname }} port=8080 state=drained exclude_hosts=somehost1,somehost2`

Any ideas?

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [October 1, 2014, 9:31pm UTC](https://forum.ansible.com/t/error-using-wait-for-exclude-hosts-option/16397/2 "2014-10-01T21:31:02Z")

</div>

Hi Kevin, this appears to be a bug. Could you please open a GitHub issue for this? The fix for this is to remove the `.split(',')` from that line.

---

<div class="post-metadata">

**Author:** ![Kevin\_Formsma](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@Kevin\_Formsma](https://forum.ansible.com/u/Kevin_Formsma)\
**Post date:** [October 2, 2014, 12:05pm UTC](https://forum.ansible.com/t/error-using-wait-for-exclude-hosts-option/16397/3 "2014-10-02T12:05:44Z")

</div>

Thanks James, I’ve opened [https://github.com/ansible/ansible/issues/9244](https://github.com/ansible/ansible/issues/9244).
