Bug 2238022

Summary: [abrt] python3-ansible-lint: get_cache_dir(): prerun.py:13:get_cache_dir:AttributeError: 'str' object has no attribute 'resolve'
Product: [Fedora] Fedora Reporter: HoracioDos <rosendeh>
Component: ansible-lintAssignee: Parag Nemade <pnemade>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: maxwell, pnemade
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/3015160b8b8a6b09813ae4820625aae572c3b95f
Whiteboard: abrt_hash:c5641727f0be9df4880e0686f8310f3b3f4c5a71;VARIANT_ID=kde;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-18 06:15:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description HoracioDos 2023-09-08 14:28:44 UTC
Description of problem:
ansible-lint error:
ansible-lint  --offline --nocolor -f codeclimate "/home/horacio/playbook.yml"
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'

Version-Release number of selected component:
python3-ansible-lint-1:6.10.0-1.fc37

Additional info:
reporter:       libreport-2.17.11
cmdline:        /usr/bin/python3 -sP /bin/ansible-lint --version
crash_function: get_cache_dir
exception_type: AttributeError
executable:     /bin/ansible-lint
interpreter:    python3-3.11.4-1.fc37.x86_64
kernel:         6.4.13-100.fc37.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
prerun.py:13:get_cache_dir:AttributeError: 'str' object has no attribute 'resolve'

Traceback (most recent call last):
  File "/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'

Local variables in innermost frame:
project_dir: '.'

Comment 1 HoracioDos 2023-09-08 14:28:47 UTC
Created attachment 1987719 [details]
File: backtrace

Comment 2 HoracioDos 2023-09-08 14:28:49 UTC
Created attachment 1987720 [details]
File: cgroup

Comment 3 HoracioDos 2023-09-08 14:28:50 UTC
Created attachment 1987721 [details]
File: cpuinfo

Comment 4 HoracioDos 2023-09-08 14:28:51 UTC
Created attachment 1987722 [details]
File: environ

Comment 5 HoracioDos 2023-09-08 14:28:52 UTC
Created attachment 1987723 [details]
File: mountinfo

Comment 6 HoracioDos 2023-09-08 14:28:54 UTC
Created attachment 1987724 [details]
File: namespaces

Comment 7 HoracioDos 2023-09-08 14:28:55 UTC
Created attachment 1987725 [details]
File: open_fds

Comment 8 Parag Nemade 2023-09-18 06:15:46 UTC

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