Accept both " import *" and " import AnsibleModule"

Hello,
in PR #14805 I provided a one line patch to allow writing modules with both:

from ansible.module_utils.<lib name> import *

and

from ansible.module_utils.<lib name> import AnsibleModule

As you can see in the build this extremely simple patch doesn’t break anything.

The reasoning behind the patch is to be able to write PEP8 compliant code (wildcard imports are discouraged).

I understand that ansible does very ‘interesting’ things with that line as it is replaced by code coming from other sources to ship a single flat file. The problem is that the line we are talking about, despite as doing something very ansible specific, looks like an import (humans, IDEs and linters alike think that’s just another regular import) so linters/IDEs trying to comply to PEP8 complains about the line.

That simple patch, addresses the issue described here and allows you to write PEP8 compliant code without breaking any functionality.

Thanks.
David

Disregard this mail. I already wrote about this topic. I thought there had been some error last time but it was correctly published.

Sorry for the spam.