Fix route map if/else #549
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
cisco iosxr_route_maps resource module fails to return facts with an error "list index out of range ".
Issue appears to be in the facts module utility in method rec_resolve_policy_data() that needs a condition if objs is defined.
ISSUE TYPE
fixes Fix route map if/else #536
COMPONENT NAME
ADDITIONAL INFORMATION
Liniking case #04095628
ansible-playbook [core 2.15.8]
python version = 3.9.6
/home/user/.ansible/collections/ansible_collections
Collection Version
cisco.iosxr 10.3.0
PLAYBOOK: route_policies_parsed.yml ***************************************************************************************************************************************************************************************************************
1 plays in route_policies_parsed.yml
PLAY [all] ****************************************************************************************************************************************************************************************************************************************
TASK [Parse the provided configuration] ***********************************************************************************************************************************************************************************************************
task path: /home/achada2/sips_automation/Adi_Local_Testing_PBs/route_policies_parsed.yml:11
The full traceback is:
File "/home/achada2/.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py", line 128, in get_network_resources_facts
inst.populate_facts(self._connection, self.ansible_facts, data)