Comment 1 for bug 1866079

Revision history for this message
Mark Goddard (mgoddard) wrote :

The command that is executed during that task is:

ansible all -i {{ kolla_inventory_path }} -e ansible_user={{ ansible_user }} -m setup > /tmp/logs/ansible/initial-setup

Essentially, gathering facts.

Reproducing on a CentOS 7 box:

sudo yum -y install python-virtualenv gcc libffi-devel openssl-devel
virtualenv ansible-2.6
source ansible-2.6/bin/activate
pip install 'ansible<2.7' 'ara<1.0.0'
cat << EOF > ansible.cfg
[defaults]
callback_plugins = $(pwd)/ansible-2.6/lib/python2.7/site-packages/ara/plugins/callbacks
EOF
./ansible-2.6/bin/ansible localhost -m setup -e ansible_python_interpreter=$(which python) -vvvv

This fails:

ansible 2.6.20
  config file = /home/mark/ansible.cfg
  configured module search path = [u'/home/mark/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mark/ansible-2.6/lib/python2.7/site-packages/ansible
  executable location = /home/mark/ansible-2.6/bin/ansible
  python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /home/mark/ansible.cfg as config file
setting up inventory plugins
Parsed /etc/ansible/hosts inventory source with ini plugin
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

Loading callback plugin minimal of type stdout, v2.0 from /home/mark/ansible-2.6/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc
ERROR! Unexpected Exception, this is probably a bug: invalid syntax (fake_filesystem.py, line 1195)
the full traceback was:

Traceback (most recent call last):
  File "/home/mark/ansible-2.6/bin/ansible", line 118, in <module>
    exit_code = cli.run()
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ansible/cli/adhoc.py", line 181, in run
    result = self._tqm.run(play)
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 231, in run
    self.load_callbacks()
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 193, in load_callbacks
    for callback_plugin in callback_loader.all(class_only=True):
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ansible/plugins/loader.py", line 489, in all
    module = self._load_module_source(name, path)
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ansible/plugins/loader.py", line 357, in _load_module_source
    module = imp.load_source(full_name, path, module_file)
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ara/plugins/callbacks/log_ara.py", line 29, in <module>
    from ara.webapp import create_app
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ara/webapp.py", line 39, in <module>
    from ara.utils import fast_count
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/ara/utils.py", line 24, in <module>
    import pyfakefs.fake_filesystem as fake_filesystem
  File "/home/mark/ansible-2.6/lib/python2.7/site-packages/pyfakefs/fake_filesystem.py", line 1195
    def utime(self, path, times=None, *, ns=None, follow_symlinks=True):
                                       ^
SyntaxError: invalid syntax

pyfakefs 4.0.0 and 4.0.1 were released yesterday, apparently without python2 support. Looks like we need to pin.

pip install 'pyfakefs<4'

Now it works.

FWIW, without the ARA callback plugin config this works.