Closed cbrito closed 11 years ago
That language construction (the one line if-else) is only supported in Python 2.5. I'm honestly not sure if it will work in 2.5 or if it requires 2.6, though, but I can at least say it won't run on 2.4 as-is.
Closing this, I don't intend to support Python earlier than 2.6. Of course, patches are always welcome...
Is there a specific version of Python required to run this?
I just downloaded the tool (great idea by the way) and tried running it with Python 2.4 and I get a syntax error.
[cbrito@ccpcmb-dt-c1-dqi xb95-nagios-api-4340fd2]$ sudo ./nagios-api -p 20000 -c /usr/local/nagios/var/rw/nagios.cmd File "./nagios-api", line 171 host = reqobj['host'] if 'host' in reqobj else None ^ SyntaxError: invalid syntax
[cbrito@ccpcmb-dt-c1-dqi xb95-nagios-api-4340fd2]$ python - Python 2.4.3 (#1, Sep 21 2011, 19:55:41) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2