Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor Python module_utils locator
* no longer recursive * embed special-case module code internally * share common code between collections/not cases * fixes #70134 * properly support subpackage redirection * adds support for FQCN redirect targets used by migration (expands to FQ Python name) * add tests
- Loading branch information
1 parent
20209c5
commit 68818d3
Showing
17 changed files
with
767 additions
and
772 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...t_user/ansible_collections/testns/othercoll/plugins/module_utils/formerly_testcoll_mod.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
def |
1 change: 1 addition & 0 deletions
1
...sible_collections/testns/othercoll/plugins/module_utils/formerly_testcoll_pkg/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
thing = "hello from testns.othercoll.formerly_testcoll_pkg.thing" |
1 change: 1 addition & 0 deletions
1
...ansible_collections/testns/othercoll/plugins/module_utils/formerly_testcoll_pkg/submod.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
thing = "hello from formerly_testcoll_pkg.submod.thing" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...llection_root_user/ansible_collections/testns/testcoll/plugins/modules/uses_mu_missing.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/python | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
import json | ||
import sys | ||
|
||
from ..module_utils import bogusmu | ||
|
||
|
||
def main(): | ||
raise Exception('should never get here') | ||
|
||
sys.exit() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
18 changes: 18 additions & 0 deletions
18
...nsible_collections/testns/testcoll/plugins/modules/uses_mu_missing_redirect_collection.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/python | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
import json | ||
import sys | ||
|
||
from ..module_utils import missing_redirect_target_collection | ||
|
||
|
||
def main(): | ||
raise Exception('should never get here') | ||
|
||
sys.exit() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
18 changes: 18 additions & 0 deletions
18
...er/ansible_collections/testns/testcoll/plugins/modules/uses_mu_missing_redirect_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/python | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
import json | ||
import sys | ||
|
||
from ..module_utils import missing_redirect_target_module | ||
|
||
|
||
def main(): | ||
raise Exception('should never get here') | ||
|
||
sys.exit() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters