generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
SUMMARY
Despite configuring cli_parse
as documented to use TTP's results: flat_list
format, the output remains wrapped in an extra list. This adds unnecessary complexity accessing the results and deviates from expected behavior.
NOTE: I could not get any of the results filters to impact the output json,csv,flat_list,raw,per_input
etc, so it may not be strictly related to flat_list
.
Comment on the issue if you need more information, happy to assist!
ISSUE TYPE
- Bug Report
COMPONENT NAME
/plugins/sub_plugins/cli_parser/ttp_parser.py
ANSIBLE VERSION
2.18.2
COLLECTION VERSION
6.0.0
CONFIGURATION
CACHE_PLUGIN(env: ANSIBLE_CACHE_PLUGIN) = jsonfile
CACHE_PLUGIN_CONNECTION(env: ANSIBLE_CACHE_PLUGIN_CONNECTION) = /runner/artifacts/99dfc5a6-d79e-4219-b3ae-2eecc6a06041/fact_cache
CONFIG_FILE() = /Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmware-upgrade/ansible.cfg
DEFAULT_CALLBACK_PLUGIN_PATH(env: ANSIBLE_CALLBACK_PLUGINS) = ['/runner/artifacts/99dfc5a6-d79e-4219-b3ae-2eecc6a06041/callback']
DEFAULT_HOST_LIST(/Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmware-upgrade/ansible.cfg) = ['/Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmwar>
DEFAULT_STDOUT_CALLBACK(env: ANSIBLE_STDOUT_CALLBACK) = awx_display
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
PERSISTENT_COMMAND_TIMEOUT(/Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmware-upgrade/ansible.cfg) = 30
PERSISTENT_CONNECT_TIMEOUT(/Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmware-upgrade/ansible.cfg) = 30
RETRY_FILES_ENABLED(env: ANSIBLE_RETRY_FILES_ENABLED) = False
SHOW_CUSTOM_STATS(/Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmware-upgrade/ansible.cfg) = True
USE_PERSISTENT_CONNECTIONS(/Volumes/extreme/Projects/Work/NetworkAutomation/AnsiblePlaybooks/ansible-cisco-switch-firmware-upgrade/ansible.cfg) = True
OS / ENVIRONMENT
- ansible-navigator 25.5.0
## EE snipped
---
images:
base_image:
name: ghcr.io/ansible/community-ansible-dev-tools:latest
ansible:
collections:
details:
ansible.netcommon: 8.0.0
ansible.posix: 2.0.0
ansible.scm: 3.0.0
ansible.utils: 6.0.0
awx.awx: 24.6.1
cisco.ios: 10.0.0
community.general: 10.7.0
version:
details: ansible [core 2.18.2]
STEPS TO REPRODUCE
- name: Parse with flat list
ansible.utils.cli_parse:
command: show install summary
parser:
name: ansible.utils.ttp
template_path: templates/ios_show_install_summary.ttp
vars:
ttp_results:
results: flat_list
TTP Template:
IMG {{ state }} {{ full_version }}
Device Output:
[ Switch 1 ] Installed Package(s) Information:
State (St): I - Inactive, U - Activated & Uncommitted,
C - Activated & Committed, D - Deactivated & Uncommitted
--------------------------------------------------------------------------------
Type St Filename/Version
--------------------------------------------------------------------------------
IMG I 16.12.1.0.544
IMG C 17.09.05.0.6450
--------------------------------------------------------------------------------
Auto abort timer: inactive
--------------------------------------------------------------------------------
Expected Output:
[
{ "state": "C", "full_version": "17.09.05.0.6450" },
{ "state": "I", "full_version": "16.12.01.0.544" }
]
Actual Output:
[
[
{ "state": "C", "full_version": "17.09.05.0.6450" },
{ "state": "I", "full_version": "16.12.01.0.544" }
]
]
EXPECTED RESULTS
- Flatten the result one level when
flat_list
is used - Or provide a documented workaround or warning about input wrapping modifying
ttp
result parameters.
Metadata
Metadata
Assignees
Labels
No labels