string comparison

38 views
Skip to first unread message

Christian Huck

unread,
May 13, 2014, 9:40:12 AM5/13/14
to ansible...@googlegroups.com
Hi,

this

when: item.mount != "/

does unfortunatly no do what it is supposed to do. The condition fails even though item.mount contains a "/".

For explanation: item.mount is derived from ansible_mounts and describes the root partition.

Any help appreciated.

Thanks in advance.

Michael DeHaan

unread,
May 14, 2014, 8:22:27 AM5/14/14
to ansible...@googlegroups.com
You're not understanding what a string equality test is.

"apple" is not equal to "a", apple *starts* with a.

when: not item.mount.startswith("/")




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/02437941-e484-44ee-b221-e0a029974839%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Huck

unread,
May 15, 2014, 6:16:21 AM5/15/14
to ansible...@googlegroups.com
sorry - that was a stupid question I guess.
Thanks for the response though.
I fixed that issue.
Reply all
Reply to author
Forward
0 new messages