MathieuAuclair MathieuAuclair - 2 months ago 52
Linux Question

python error while ipsec verify under archlinux

I've been trying to setup a l2tp vpn connection for my computer, and while following the guide, I felt on a python error on line 84
link to the Openswan L2TP/IPsec VPN client setup guide.

ipsec verify

File "/usr/local/libexec/ipsec/verify", line 84
print "\t[%s%s%s]"%(FAIL,rtext,ENDC)
SyntaxError: invalid syntax

OpenSwan service is up and running, and I've checked in
to check if there was anything wrong and it does not look like it,
does anyone have an idea of what I could use for a work around

If you need command output just ask!
Thanks for reading

Answer Source

Your error indicates that you are executing a python2 script with python3.

# python3
# python2
print 'hi'

Based on the xelerance/Openswan's ipsec/verify source, the shebang (first line of the script) indicates it will be using /usr/bin/python which in your case, on ArchLinux, is python3 ;)


As described in the archlinux python wiki you may replace python with python2 directly on the file and it should start running again.

You could probably do a pull request directly on the project to ask for python3 support or at least using an env shebang like the following:

#!/usr/bin/env python

You can also manually change the file on your system with a python2 shebang

#!/usr/bin/env python2

As long as you have python2 installed on your system ;)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download