Bug 2213600 - ansible-lint throws trace-back when mistyping file-name
Summary: ansible-lint throws trace-back when mistyping file-name
Keywords:
Status: CLOSED DUPLICATE of bug 2213747
Alias: None
Product: Fedora
Classification: Fedora
Component: python-ansible-compat
Version: 37
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: chedi toueiti
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-08 16:45 UTC by David Juran
Modified: 2023-08-03 06:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-03 06:55:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Juran 2023-06-08 16:45:10 UTC
[david@localhost ansible]$ rpm -q python3-ansible-lin

[david@localhost ansible]$ ansible-lint file_which_does_not_exist
Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 8, in <module>
    sys.exit(_run_cli_entrypoint())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ansiblelint/__main__.py", line 344, in _run_cli_entrypoint
    sys.exit(main(sys.argv))
             ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ansiblelint/__main__.py", line 197, in main
    initialize_options(argv[1:])
  File "/usr/lib/python3.11/site-packages/ansiblelint/__main__.py", line 110, in initialize_options
    options.cache_dir = get_cache_dir(options.project_dir)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ansible_compat/prerun.py", line 13, in get_cache_dir
    basename = project_dir.resolve().name.encode(encoding="utf-8")
               ^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'resolve'


Reproducible:

Comment 1 Parag Nemade 2023-06-10 13:46:12 UTC
This happened due to new update of ansible-compat in F37
The last known ansible-lint build is ansible-lint-6.10.0-1.fc37
which is working fine with python-ansible-compat-2.2.7-9.fc37
but then python-ansible-compat directly got an update to 4.0.4-1.fc37 which broke ansible-lint command.

Comment 2 Parag Nemade 2023-08-03 06:55:08 UTC

*** This bug has been marked as a duplicate of bug 2213747 ***


Note You need to log in before you can comment on or make changes to this bug.