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

Fix ansible-test relative import analysis. #70973

Merged
merged 1 commit into from Jul 30, 2020

Conversation

mattclay
Copy link
Member

SUMMARY

Fix ansible-test relative import analysis.

Replaces #70866
Resolves ansible-collections/amazon.aws#110

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible-test

@mattclay
Copy link
Member Author

cc @tremble

@ansibot ansibot added affects_2.11 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels Jul 29, 2020
@mattclay mattclay removed the needs_triage Needs a first human triage before being processed. label Jul 29, 2020
# This assumes that all files within the collection are executed by Ansible as part of the collection.
# While that will usually be true, there are exceptions which will result in this resolution being incorrect.
self.module = path_to_module(os.path.join(data_context().content.collection.directory, self.path))

# noinspection PyPep8Naming
# pylint: disable=locally-disabled, invalid-name
def visit_Import(self, node):
Copy link
Contributor

Choose a reason for hiding this comment

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

Dumb question: should visit_Import be updated too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only the from ... import statement supports relative imports, so there's nothing to do for the import statement.

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

For what it's worth I've tested this locally and it appears to be working as expected...

@mattclay mattclay merged commit 2e0097a into ansible:devel Jul 30, 2020
@mattclay mattclay deleted the at-relative-import-analysis branch July 30, 2020 15:05
@ansible ansible locked and limited conversation to collaborators Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.11 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

module_util changes don't trigger 'ci_complete'
3 participants