diff options
author | flowerysong <paul.arthur@flowerysong.com> | 2019-05-03 03:15:58 +0200 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2019-05-03 03:15:57 +0200 |
commit | 2ef8b297ffdb98613b3d64791828e760fb2193c4 (patch) | |
tree | fe2c2ab726a875496c11dce388d8160f7db99fac /test/integration/targets/collections/collection_root_user | |
parent | Fix non-signature authentication (#56038) (diff) | |
download | ansible-2ef8b297ffdb98613b3d64791828e760fb2193c4.tar.xz ansible-2ef8b297ffdb98613b3d64791828e760fb2193c4.zip |
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
Diffstat (limited to 'test/integration/targets/collections/collection_root_user')
2 files changed, 22 insertions, 0 deletions
diff --git a/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/doc_fragments/frag.py b/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/doc_fragments/frag.py new file mode 100644 index 0000000000..0ff430b600 --- /dev/null +++ b/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/doc_fragments/frag.py @@ -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 +''' diff --git a/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/testmodule.py b/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/testmodule.py index 58d3152f28..d0220af901 100644 --- a/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/testmodule.py +++ b/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/testmodule.py @@ -2,6 +2,14 @@ import json +DOCUMENTATION = r''' +module: testmodule +description: for testing +extends_documentation_fragment: + - testns.testcoll.frag + - testns.testcoll.frag.other_documentation +''' + def main(): print(json.dumps(dict(changed=False, source='user'))) |