Is this jinja array or list if it starts with [u' ?

17 views
Skip to first unread message

Abey Thomas

unread,
Oct 27, 2017, 12:11:37 PM10/27/17
to Ansible Project
Hi,

I tried to convert a hash to a list. When I try to debug my list its showing 

"msg": "    [u'value1', u'value2']\n"

Looks like an array to me. What kind of object is this? Can i convert this back to list? I tried to do us  append(value) in a loop to build this value array

Regards,
Abey

Brian Coca

unread,
Oct 27, 2017, 12:25:17 PM10/27/17
to Ansible Project
Array and List are 2 different names for the same thing, what you are
seeing is an array/list of unicode strings (leading u' ' in front of
string means its unicode in Python).



--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages