I'm trying to edit a Python module, but I'm not getting the value I expect from a variable. The code is:
def populate_ipv4_interfaces(self, data):
for key, value in data.items():
vrf = re.findall(r'VPN Routing/Forwarding "(.+)"', value)
where I'm expecting a string value to be output. It does contain my string, but something else. When I force it to be a string like this:
vrf = str(re.findall(r'VPN Routing/Forwarding "(.+)"', value))
gives me the value "[u'Internet']" instead of "Internet".
I've looked up the u, and I realise this denotes a unicode character, but I don't know why it's pulling that information along with the string.
If it helps, this is an ansible module, but I've narrowed it down to this one variable, since if I specify a string in the fact instead of this variable, everything works as intended.
Can someone tell me why I'm seeing this behaviour?