david-caro / python-foreman

Small low level python wrapper around Foreman API
GNU General Public License v2.0
57 stars 37 forks source link

Unable to use with Python 2.6 #58

Closed fatmcgav closed 8 years ago

fatmcgav commented 8 years ago

I'm trying to install this on a CentOS 6 machine, however by default it's got Python 2.6.6 installed.

It looks like Subprocess.check_output was introduced in Python 2.7, so that causes the setup to fail here: https://github.com/david-caro/python-foreman/blob/master/setup.py#L4

Not sure if there's a work-around to enable support for Python 2.6?

Cheers Gav

david-caro commented 8 years ago

Mm, you can try commenting out the import and manually creating the PKG-INFO with the 'Version: X.Y.Z' line putting there the output of the scripts/generate_version.sh command as a workaround.

I'll try to patch it asap

david-caro commented 8 years ago

Though I recommend you upgrade to 2.7 (centos7) as I'm not sure how much time I'll have to keep the code compatible with older python

david-caro commented 8 years ago

I've created branch #59 that should fix that, can you try it out?

fatmcgav commented 8 years ago

@david-caro Cheers for the quick response. Will give the branch a go tomorrow.

Am planning on upgrading to CentOS 7 at some point hopefully, however I'm sure I read that it still ships with Python 2.6... :S

fatmcgav commented 8 years ago

@david-caro Works great for me on CentOS 6 with Python 2.6.6 :)

david-caro commented 8 years ago

I'll merge it then, would it help doing a new release on pypi?

fatmcgav commented 8 years ago

@david-caro Cool, cheers... A new release might well be useful, however would hold off for the minute, as I've just spotted an issue with running against Foreman 1.9 which I'm about to raise :)