Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Molecule Verify Command Producing Error #2002

Closed
vignajethkk opened this issue Apr 23, 2019 · 2 comments
Closed

Molecule Verify Command Producing Error #2002

vignajethkk opened this issue Apr 23, 2019 · 2 comments
Labels

Comments

@vignajethkk
Copy link

vignajethkk commented Apr 23, 2019

i ran molecule init role -r mol_docker_test_2 -d docker --verifier-name testinfra and then molecule --debug converge and finally molecule verify

the error is got was

molecule verify
--> Validating schema /path/mol_docker_test_2/molecule/default/molecule.yml.
Validation completed successfully.
--> Test matrix

└── default
    └── verify

--> Scenario: 'default'
--> Action: 'verify'
--> Executing Testinfra tests found in /path/mol_docker_test_2/molecule/default/tests/...
    ============================= test session starts ==============================
    platform darwin -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
    rootdir: /path/mol_docker_test_2/molecule/default
    plugins: testinfra-1.19.0
collected 0 items / 1 errors

    ==================================== ERRORS ====================================
    ____________________ ERROR collecting tests/test_default.py ____________________
    tests/test_default.py:6: in <module>
        os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
    /usr/local/lib/python3.7/site-packages/testinfra/utils/ansible_runner.py:153: in __init__
        self.cli.options = self.cli.base_parser(
    E   AttributeError: 'PlaybookCLI' object has no attribute 'base_parser'
    =============================== warnings summary ===============================
    /Users/user_name/Library/Python/3.7/lib/python/site-packages/jinja2/utils.py:485
      /Users/user_name/Library/Python/3.7/lib/python/site-packages/jinja2/utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
        from collections import MutableMapping

    /Users/user_name/Library/Python/3.7/lib/python/site-packages/jinja2/runtime.py:318
      /Users/user_name/Library/Python/3.7/lib/python/site-packages/jinja2/runtime.py:318: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
        from collections import Mapping

    /Users/user_name/Library/Python/3.7/lib/python/site-packages/yaml/constructor.py:126
      /Users/user_name/Library/Python/3.7/lib/python/site-packages/yaml/constructor.py:126: DeprecationWarning: Using or importing the ABCsfrom 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
        if not isinstance(key, collections.Hashable):

    -- Docs: https://docs.pytest.org/en/latest/warnings.html
    !!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
    ===================== 3 warnings, 1 error in 0.46 seconds ======================

the versions i use

molecule --version
molecule, version 2.20.0
py.test --version
This is pytest version 4.4.1, imported from /usr/local/lib/python3.7/site-packages/pytest.py
setuptools registered plugins:
  testinfra-1.19.0 at /usr/local/lib/python3.7/site-packages/testinfra/plugin.py
docker --version
Docker version 18.09.0, build 4d60db4

my default_python.py file looks like

import os

import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')


def test_hosts_file(host):
    f = host.file('/etc/hosts')

    assert f.exists
    assert f.user == 'root'
    assert f.group == 'root'
@decentral1se
Copy link
Contributor

Hi @vignajethkk, you've ran into a compatability issue with Ansible 2.8 here which we're tracking over at #1727. I would probably close this and track from there if you don't mind. Thanks.

@decentral1se
Copy link
Contributor

Please feel free to re-open if I've got it wrong. Solution to this would be to downgrade Ansible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants