Skip to content
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

Use absolute instead of relative imports #15154

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

wilfriedroset
Copy link

@wilfriedroset wilfriedroset commented Apr 29, 2024

SUMMARY

Although Ansible without mitogen works without this PR it is not possible to use it with Mitogen.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change

Without the fix Mitogen's users should expect the following error:

exception: "Traceback (most recent call last):\r\n  File \"/home/runner/.ansible/tmp/ansible_mitogen_runner_w8wene42/job_launch.py\", line 177, in <module>\r\n    from ..module_utils.controller_api import ControllerAPIModule\r\nImportError: attempted relative import with no known parent package\r\n"
COMPONENT NAME
  • Collection
AWX VERSION
awx: 24.3.1.dev11+g207ab32994
ADDITIONAL INFORMATION

This is similar to ansible-collections/amazon.aws#809

Although Ansible without mitogen works without this PR it is not
possible to use it with Mitogen.

This is similar to ansible-collections/amazon.aws#809

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
@github-actions github-actions bot added component:awx_collection issues related to the collection for controlling AWX community labels Apr 29, 2024
@AlanCoding
Copy link
Member

The problem is that this is re-packaged under another namespace.

@wilfriedroset
Copy link
Author

Thank @AlanCoding for your feedbacks. Would you be able to point me in the right direction to adresse the repackaging issue?

@fosterseth
Copy link
Member

awx.awx becomes ansible.controller on automation hub

@wilfriedroset
Copy link
Author

Thank you for the hint @fosterseth. Now I'm confused because I believe thatawx.awx is the correct name when the collection is used by end users but after the repackaging it is named ansible.controller.
So basically, if instead of doing absolute import with awx.awx I use ansible.controller the CI should be happy but what about the end users 🤔

Anyhow, I'm not familiar with the re-packaging and the CI of AWX. I will have to look at this closer maybe next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community component:awx_collection issues related to the collection for controlling AWX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants