Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix loading namespaced doc_fragments from collections (#55249)
* Fix loading namespaced doc_fragments The syntax for specifying a different fragment name was already using '.' as a separator, so the code needed to be tweaked to avoid choking on names like `testns.testcoll.fragname` and `testns.testcoll.fragname.altvar`. `get_plugin_class()` returns 'docfragment' for the fragment loader; mangling `subdir` provides consistent alignment with the normal plugin directory names and avoids needing special handling of plugin types with 'module' in the name. * Add changelog entry
- Loading branch information
1 parent
fcca1a1
commit 2ef8b29
Showing
6 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/55249-doc_fragments_from_collections.yml
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,2 @@ | ||
bugfixes: | ||
- Fixed loading namespaced documentation fragments from collections. |
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
14 changes: 14 additions & 0 deletions
14
...ns/collection_root_user/ansible_collections/testns/testcoll/plugins/doc_fragments/frag.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,14 @@ | ||
class ModuleDocFragment(object): | ||
DOCUMENTATION = r''' | ||
options: | ||
normal_doc_frag: | ||
description: | ||
- an option | ||
''' | ||
|
||
OTHER_DOCUMENTATION = r''' | ||
options: | ||
other_doc_frag: | ||
description: | ||
- another option | ||
''' |
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