Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

ansible-test sanity throws error on helm 'import outside toplevel' #132

Closed
geerlingguy opened this issue Jun 16, 2020 · 2 comments
Closed

Comments

@geerlingguy
Copy link
Collaborator

SUMMARY

When running ansible-test sanity locally in my Python 3.7 environment, I get the following error:

Running sanity test 'pylint' with Python 3.7
ERROR: Found 1 pylint issue(s) which need to be resolved:
ERROR: plugins/modules/helm.py:345:12: import-outside-toplevel: Import outside toplevel (tempfile)
ISSUE TYPE
  • Bug Report
COMPONENT NAME

helm

ANSIBLE VERSION
ansible 2.9.9
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/Users/jgeerling/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.7 (default, Apr  9 2020, 17:13:06) [Clang 11.0.3 (clang-1103.0.32.29)]
CONFIGURATION

N/A

OS / ENVIRONMENT

macOS

STEPS TO REPRODUCE

Run the following in this repository:

ansible-test sanity
EXPECTED RESULTS

Tests pass.

ACTUAL RESULTS

See summary.

@geerlingguy
Copy link
Collaborator Author

Looks like the issue is in:

    if release_values != {}:
        try:
            import tempfile
        except ImportError:
            module.fail_json(
                msg=missing_required_lib("tempfile"),
                exception=traceback.format_exc(),
                stdout='',
                stderr='',
                command='',
            )

@geerlingguy
Copy link
Collaborator Author

This was fixed in #115.

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

Successfully merging a pull request may close this issue.

1 participant