Skip to content

release 0.14rc2 produces stack trace when trying to read vaulted file #86

Open
@ansiblejunky

Description

We are using the latest RC (0.14rc2) and had a vaulted file vars/pass.yml and ansible-review crashed with stacktrace when it hit that file. ansible-review is being triggered through pre-commit in this case.

WARN: RoleVars vars/pass.yml is in a role that contains a meta/main.yml without a declared standards version. Using latest standards version 0.1

Traceback (most recent call last):

  File "/home/user/.cache/pre-commit/repolIoGop/py_env-python2.7/bin/ansible-review", line 10, in <module>

    sys.exit(main())

  File "/home/user/.cache/pre-commit/repolIoGop/py_env-python2.7/lib/python2.7/site-packages/ansiblereview/__main__.py", line 102, in main

    errors = errors + candidate.review(options, lines)

  File "/home/user/.cache/pre-commit/repolIoGop/py_env-python2.7/lib/python2.7/site-packages/ansiblereview/__init__.py", line 76, in review

    return utils.review(self, settings, lines)

  File "/home/user/.cache/pre-commit/repolIoGop/py_env-python2.7/lib/python2.7/site-packages/ansiblereview/utils/__init__.py", line 121, in review

    result = standard.check(candidate, settings)

  File "/home/user/.cache/pre-commit/repolIoGop/py_env-python2.7/lib/python2.7/site-packages/ansiblereview/vars.py", line 45, in repeated_vars

    for err_key in errors for err_line in errors[err_key]])

TypeError: string indices must be integers, not str

The workaround was to replace the vaulted file with a file containing encrypt_string vaulted strings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions