Skip to content

Commit

Permalink
Fix collections in stdout mode (#1526)
Browse files Browse the repository at this point in the history
* Fix collections in stdout mode

* Improve the logic

* cleanup
  • Loading branch information
shatakshiiii authored Jun 8, 2023
1 parent 337fc8c commit c3dfae0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ansible_navigator/actions/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,17 @@ def _get_collection_plugins_details(self, selected_collection: dict) -> dict:
)
plugin_docs["path"] = plugin_path
if plugin and plugin["doc"] is not None:
if "name" in plugin["doc"]:
short_name = plugin["doc"]["name"]
try:
if "name" in plugin["doc"]:
short_name = plugin["doc"]["name"]
else:
short_name = plugin["doc"][plugin_type]
except KeyError:
short_name = None
if short_name is None:
plugin_docs["full_name"] = selected_collection["known_as"]
else:
short_name = plugin["doc"][plugin_type]
plugin_docs["full_name"] = f"{selected_collection['known_as']}.{short_name}"
plugin_docs["full_name"] = f"{selected_collection['known_as']}.{short_name}"

if "short_description" in plugin["doc"]:
plugin_docs["short_description"] = plugin["doc"]["short_description"]
Expand Down

0 comments on commit c3dfae0

Please sign in to comment.