ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 394 forks source link

sa-ansible-container from PyPI fails to install using python 3 #972

Closed eerorika closed 5 years ago

eerorika commented 5 years ago
ISSUE TYPE
SUMMARY

sa-ansible-container from PyPI fails to install using python 3.

STEPS TO REPRODUCE

Attempt to install sa-ansible-container from pypi using python 3.

pip install sa-ansible-container
EXPECTED RESULTS

sa-ansible-container package should be installed successfully.

ACTUAL RESULTS
Collecting sa-ansible-container
  Using cached https://files.pythonhosted.org/packages/df/7a/61cf49bef5c1796bc78e46fbbc2aac2e45825475d60601ba505c97a17f66/sa-ansible-container-0.9.3rc2.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-install-g1gogaz1/sa-ansible-container/setup.py", line 82
        print "=========================="
                                         ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("==========================")?

    ----------------------------------------
Fix

Following patch fixes the bug:

--- setup.py    2018-11-16 00:19:11.000000000 +0200
+++ setup.py.fixed      2018-11-16 00:20:38.437642794 +0200
@@ -79,8 +79,8 @@
         from container import core
         if self.debug:
             LOGGING['loggers']['container']['level'] = 'DEBUG'
-        print "=========================="
-        print  self.conductor_provider
+        print("==========================")
+        print(self.conductor_provider)
         config.dictConfig(LOGGING)
         core.hostcmd_prebake(self.distros, debug=self.debug, cache=self.cache,
                              ignore_errors=self.ignore_errors, conductor_provider=self.conductor_provider)

That said, the buggy version of the file appears to only exist in the package in PyPI. I'm unable to find the buggy version of the file in either softasap/ansible-container or ansible/ansible-container. So, simply deploying a new preview version using the current HEAD code seems to be a possible solution.

Voronenko commented 5 years ago

Note - I am not sure, if codebase for ansible-container is ready for python 3. So this might be not the single case.

I would recommend virtual env with python 2 for working with tool anyway.

eerorika commented 5 years ago

At least the installation guide suggests that 3 should be supported:

Prerequisites:

  • Python 2.7 or Python 3.5
Voronenko commented 5 years ago

Ok, will move forward version tip, and publish next snapshot on pypi

Voronenko commented 5 years ago

Published snapshot build 0.9.3rc3 seems to have that issue solved.