Skip to content

Address too many values to unpack when there's subdirectories for roles #4566

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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

tombosmansibm
Copy link

Fixes #4452

<...>
File "/home/user/.local/share/virtualenvs/globster-e1myMWbg/lib/python3.11/site-packages/ansiblelint/utils.py", line 563, in _rolepath
namespace_name, collection_name, role_name = parse_fqcn(role)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)

This change supports 1 subdirectory level (similar to the playbook code)

@ssbarnea ssbarnea changed the title fix: too many values to unpack when there's subdirectories for roles Address too many values to unpack when there's subdirectories for roles Apr 1, 2025
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with core and they mentioned that also multiple directories are supported. Please change it to allow any number of levels.

@ssbarnea ssbarnea marked this pull request as draft April 2, 2025 12:11
@tombosmansibm
Copy link
Author

I've updated the code, so it now handles multiple levels, and updated the test as well.

@tombosmansibm tombosmansibm marked this pull request as ready for review April 2, 2025 13:17
@tombosmansibm tombosmansibm requested a review from ssbarnea April 2, 2025 13:19
@samccann
Copy link
Contributor

samccann commented Apr 2, 2025

@ssbarnea just fyi that this is impacting certified collection approvals.

…too_many_values_to_unpack

# Conflicts:
#	tox.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

ansible-lint fails parsing FQCN roles within subdirectories
3 participants