thefinn93 / ansible-letsencrypt

An ansible role to generate TLS certificates and get them signed by Let's Encrypt
GNU General Public License v3.0
440 stars 122 forks source link

Prefer Python 2 #32

Closed miohtama closed 8 years ago

miohtama commented 8 years ago

It is possible the role picks Python 3 for the virtual env Python depending on the target system. certbot (letsencrypt client) is not Python compatible. The exception below will occur.

This patch forces to create Python 2 virtualenv.

msg: stdout: Collecting letsencrypt
  Using cached letsencrypt-0.6.0.tar.gz
Collecting certbot (from letsencrypt)
  Using cached certbot-0.6.0.tar.gz
Collecting acme==0.6.0 (from certbot->letsencrypt)
  Using cached acme-0.6.0-py2.py3-none-any.whl
Collecting ConfigArgParse>=0.9.3 (from certbot->letsencrypt)
  Using cached ConfigArgParse-0.10.0.tar.gz
Collecting configobj (from certbot->letsencrypt)
  Using cached configobj-5.0.6.tar.gz
Collecting cryptography>=0.7 (from certbot->letsencrypt)
  Using cached cryptography-1.3.2.tar.gz
Collecting parsedatetime>=1.3 (from certbot->letsencrypt)
  Using cached parsedatetime-2.1.tar.gz
Collecting psutil>=2.1.0 (from certbot->letsencrypt)
  Using cached psutil-4.2.0.tar.gz
Collecting PyOpenSSL (from certbot->letsencrypt)
  Using cached pyOpenSSL-16.0.0-py2.py3-none-any.whl
Collecting pyrfc3339 (from certbot->letsencrypt)
  Using cached pyRFC3339-1.0-py2.py3-none-any.whl
Collecting python2-pythondialog>=3.2.2rc1 (from certbot->letsencrypt)
  Using cached python2-pythondialog-3.4.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-xp7bp1t8/python2-pythondialog/setup.py", line 32, in <module>
        from dialog import __version__ as VERSION
      File "/tmp/pip-build-xp7bp1t8/python2-pythondialog/dialog.py", line 264
        except OSError, e:
                      ^
    SyntaxError: invalid syntax

    ----------------------------------------

:stderr: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xp7bp1t8/python2-pythondialog/
thefinn93 commented 8 years ago

Good point! Thanks for the PR