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

Display sidecar plugin in the collections list #1531

Merged
merged 9 commits into from
May 18, 2023
3 changes: 2 additions & 1 deletion src/ansible_navigator/data/catalog_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def _catalog_plugins(self, collection: dict) -> None:
plugin_type = plugin_dir.name
if plugin_type == "modules":
plugin_type = "module"
filenames = plugin_dir.glob("**/*.py")
files = list(plugin_dir.glob("**/*.py")) + list(plugin_dir.glob("**/*.yml"))
filenames = (x for x in files)
self._process_plugin_dir(
plugin_type,
filenames,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
},
"output": [
" Company name.coll 1 Type Added Deprecated Description",
"0│lookup_1 lookup 1.0.0 False This is test lookup plugin",
"1│mod_1 module 1.0.0 False This is a test module",
"2│role_full role Unknown Unknown Complete sample role.",
"3│role_minimum role Unknown Unknown Minimal sample role.",
"0│filter_1 filter 1.0.0 False This is test filter plugin",
"1│lookup_1 lookup 1.0.0 False This is test lookup plugin",
"2│mod_1 module 1.0.0 False This is a test module",
"3│role_full role Unknown Unknown Complete sample role.",
"4│role_minimum role Unknown Unknown Minimal sample role.",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help"
]
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
{
"name": "test[10-:back-Back to ansible-navigator collections browse window]",
"name": "test[10-:4-role_minimal details window]",
"index": 10,
"comment": "Back to ansible-navigator collections browse window",
"comment": "role_minimal details window",
"additional_information": {
"present": [
"ansible.builtin",
"company_name.coll_1",
"company_name.coll_2"
],
"present": [],
"absent": [],
"compared_fixture": false
"compared_fixture": true
},
"output": [
" Name Version Shadowed Type Path",
"0│ansible.builtin 2.14.1 False contained /usr/local/lib/python3.XX/site-packages/ansible",
"1│company_name.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_1",
"2│company_name.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_2",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help"
"Image: company_name.coll_1.role_minimum",
"Description: Minimal sample role.",
" 0│---",
" 1│argument_specs: {}",
" 2│argument_specs_path: ''",
" 3│defaults: {}",
" 4│defaults_path: ''",
" 5│full_name: company_name.coll_1.role_minimum",
" 6│info:",
" 7│ dependencies: []",
" 8│ galaxy_info:",
" 9│ author: Ansible team (ansible-navigator)",
"10│ company: Ansible",
"11│ description: Minimal sample role.",
"12│ galaxy_tags:",
"13│ - tag_1",
"14│ - tag_2",
"15│ license: LICENSE",
"16│ min_ansible_version: 2.9.0",
"17│ platforms:",
"18│ - name: eos",
"19│ versions:",
"20│ - all",
"21│info_path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_1/roles/role_minimum/meta/main.yml",
"22│readme: |-",
"23│ # Role minimum",
"24│",
"25│ This is a role with:",
"26│",
"27│ - meta/main.yml",
"28│ - README.md",
"29│",
"30│ This is a role without:",
"31│",
"32│ - defaults/main.yml",
"33│ - meta/argument_spec.yml",
"34│readme_path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_1/roles/role_minimum/README.md",
"35│short_name: role_minimum",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help"
]
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "test[11-:2-Browse company_name.coll_2 plugins window]",
"name": "test[11-:back-Back to browse company_name.coll_1 plugins window]",
"index": 11,
"comment": "Browse company_name.coll_2 plugins window",
"comment": "Back to browse company_name.coll_1 plugins window",
"additional_information": {
"present": [],
"absent": [],
"compared_fixture": true
},
"output": [
" Company name.coll 2 Type Added Deprecated Description",
"0│lookup_2 lookup 2.0.0 False This is test lookup plugin",
"1│mod_2 module 2.0.0 False This is a test module",
" Company name.coll 1 Type Added Deprecated Description",
"0│filter_1 filter 1.0.0 False This is test filter plugin",
"1│lookup_1 lookup 1.0.0 False This is test lookup plugin",
"2│mod_1 module 1.0.0 False This is a test module",
"3│role_full role Unknown Unknown Complete sample role.",
"4│role_minimum role Unknown Unknown Minimal sample role.",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help"
]
}
Original file line number Diff line number Diff line change
@@ -1,59 +1,21 @@
{
"name": "test[12-:0-lookup_2 plugin docs window]",
"name": "test[12-:back-Back to ansible-navigator collections browse window]",
"index": 12,
"comment": "lookup_2 plugin docs window",
"comment": "Back to ansible-navigator collections browse window",
"additional_information": {
"present": [],
"present": [
"ansible.builtin",
"company_name.coll_1",
"company_name.coll_2"
],
"absent": [],
"compared_fixture": true
"compared_fixture": false
},
"output": [
"Image: company_name.coll_2.lookup_2",
"Description: This is test lookup plugin",
" 0│---",
" 1│additional_information: {}",
" 2│collection_info:",
" 3│ authors:",
" 4│ - Ansible team (ansible-navigator)",
" 5│ license_file: LICENSE",
" 6│ name: company_name.coll_2",
" 7│ namespace: company_name",
" 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_2",
" 9│ readme: README.md",
"10│ shadowed_by: []",
"11│ version: 2.0.0",
"12│doc:",
"13│ author: test",
"14│ description:",
"15│ - This is test lookup plugin",
"16│ name: lookup_2",
"17│ notes:",
"18│ - This is a dummy lookup plugin",
"19│ options:",
"20│ bar:",
"21│ default: candidate",
"22│ description:",
"23│ - Dummy option I(bar)",
"24│ type: str",
"25│ foo:",
"26│ description:",
"27│ - Dummy option I(foo)",
"28│ required: true",
"29│ type: str",
"30│ plugin_type: lookup",
"31│ short_description: This is test lookup plugin",
"32│ version_added: 2.0.0",
"33│ version_added_collection: company_name.coll_2",
"34│examples: |-",
"35│ - name: Retrieve a value deep inside a using a path",
"36│ ansible.builtin.set_fact:",
"37│ value: \"{{ lookup('company_name.coll_2.lookup_2', var1, var2) }}\"",
"38│full_name: company_name.coll_2.lookup_2",
"39│metadata: null",
"40│returndocs:",
"41│ _raw:",
"42│ description:",
"43│ - One or more zero-based indices of the matching list items.",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help"
" Name Version Shadowed Type Path",
"0│ansible.builtin 2.14.1 False contained /usr/local/lib/python3.XX/site-packages/ansible",
"1│company_name.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_1",
"2│company_name.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_2",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help"
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test[13-:back-Back to browse company_name.coll_2 plugins window]",
"name": "test[13-:2-Browse company_name.coll_2 plugins window]",
"index": 13,
"comment": "Back to browse company_name.coll_2 plugins window",
"comment": "Browse company_name.coll_2 plugins window",
"additional_information": {
"present": [],
"absent": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "test[14-:1-mod_2 plugin docs window]",
"name": "test[14-:0-lookup_2 plugin docs window]",
"index": 14,
"comment": "mod_2 plugin docs window",
"comment": "lookup_2 plugin docs window",
"additional_information": {
"present": [],
"absent": [],
"compared_fixture": true
},
"output": [
"Image: company_name.coll_2.mod_2",
"Description: This is a test module",
"Image: company_name.coll_2.lookup_2",
"Description: This is test lookup plugin",
" 0│---",
" 1│additional_information: {}",
" 2│collection_info:",
Expand All @@ -23,46 +23,37 @@
"10│ shadowed_by: []",
"11│ version: 2.0.0",
"12│doc:",
"13│ author:",
"14│ - test",
"15│ description:",
"16│ - This is a test module",
"17│ module: mod_2",
"18│ notes:",
"19│ - This is a dummy module",
"20│ options:",
"21│ bar:",
"22│ aliases:",
"23│ - bam",
"24│ choices:",
"25│ - candidate",
"26│ - running",
"27│ default: candidate",
"28│ description:",
"29│ - Dummy option I(bar)",
"30│ type: str",
"31│ foo:",
"32│ description:",
"33│ - Dummy option I(foo)",
"34│ type: str",
"35│ short_description: This is a test module",
"36│ version_added: 2.0.0",
"37│ version_added_collection: company_name.coll_2",
"38│examples: |-",
"39│ - name: test task-1",
"40│ company_name.coll_2.mod_2:",
"41│ foo: somevalue",
"42│ bar: candidate",
"43│full_name: company_name.coll_2.mod_2",
"44│metadata: null",
"45│returndocs:",
"46│ baz:",
"47│ description: test return 1",
"48│ returned: success",
"49│ sample:",
"50│ - a",
"51│ - b",
"52│ type: list",
"13│ author: test",
"14│ description:",
"15│ - This is test lookup plugin",
"16│ name: lookup_2",
"17│ notes:",
"18│ - This is a dummy lookup plugin",
"19│ options:",
"20│ bar:",
"21│ default: candidate",
"22│ description:",
"23│ - Dummy option I(bar)",
"24│ type: str",
"25│ foo:",
"26│ description:",
"27│ - Dummy option I(foo)",
"28│ required: true",
"29│ type: str",
"30│ plugin_type: lookup",
"31│ short_description: This is test lookup plugin",
"32│ version_added: 2.0.0",
"33│ version_added_collection: company_name.coll_2",
"34│examples: |-",
"35│ - name: Retrieve a value deep inside a using a path",
"36│ ansible.builtin.set_fact:",
"37│ value: \"{{ lookup('company_name.coll_2.lookup_2', var1, var2) }}\"",
"38│full_name: company_name.coll_2.lookup_2",
"39│metadata: null",
"40│returndocs:",
"41│ _raw:",
"42│ description:",
"43│ - One or more zero-based indices of the matching list items.",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help"
]
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,68 @@
{
"name": "test[16-:back-Back to ansible-navigator collections browse window]",
"name": "test[16-:1-mod_2 plugin docs window]",
"index": 16,
"comment": "Back to ansible-navigator collections browse window",
"comment": "mod_2 plugin docs window",
"additional_information": {
"present": [
"ansible.builtin",
"company_name.coll_1",
"company_name.coll_2"
],
"present": [],
"absent": [],
"compared_fixture": false
"compared_fixture": true
},
"output": [
" Name Version Shadowed Type Path",
"0│ansible.builtin 2.14.1 False contained /usr/local/lib/python3.XX/site-packages/ansible",
"1│company_name.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_1",
"2│company_name.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_2",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help"
"Image: company_name.coll_2.mod_2",
"Description: This is a test module",
" 0│---",
" 1│additional_information: {}",
" 2│collection_info:",
" 3│ authors:",
" 4│ - Ansible team (ansible-navigator)",
" 5│ license_file: LICENSE",
" 6│ name: company_name.coll_2",
" 7│ namespace: company_name",
" 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/company_name/coll_2",
" 9│ readme: README.md",
"10│ shadowed_by: []",
"11│ version: 2.0.0",
"12│doc:",
"13│ author:",
"14│ - test",
"15│ description:",
"16│ - This is a test module",
"17│ module: mod_2",
"18│ notes:",
"19│ - This is a dummy module",
"20│ options:",
"21│ bar:",
"22│ aliases:",
"23│ - bam",
"24│ choices:",
"25│ - candidate",
"26│ - running",
"27│ default: candidate",
"28│ description:",
"29│ - Dummy option I(bar)",
"30│ type: str",
"31│ foo:",
"32│ description:",
"33│ - Dummy option I(foo)",
"34│ type: str",
"35│ short_description: This is a test module",
"36│ version_added: 2.0.0",
"37│ version_added_collection: company_name.coll_2",
"38│examples: |-",
"39│ - name: test task-1",
"40│ company_name.coll_2.mod_2:",
"41│ foo: somevalue",
"42│ bar: candidate",
"43│full_name: company_name.coll_2.mod_2",
"44│metadata: null",
"45│returndocs:",
"46│ baz:",
"47│ description: test return 1",
"48│ returned: success",
"49│ sample:",
"50│ - a",
"51│ - b",
"52│ type: list",
"^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help"
]
}
Loading