zorkian / nagios-api

A REST-like, JSON interface to Nagios
BSD 3-Clause "New" or "Revised" License
586 stars 173 forks source link

Specific Python Version Required? #2

Closed cbrito closed 11 years ago

cbrito commented 12 years ago

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

zorkian commented 12 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.

zorkian commented 11 years ago

Closing this, I don't intend to support Python earlier than 2.6. Of course, patches are always welcome...