Skip to content

Fix route map if/else #536

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sean-m-sullivan
Copy link
Contributor

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
  • Bugfix Pull Request
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)

Update eleif section for resolve route police data for route maps
update changelog
Copy link
Member

@Ruchip16 Ruchip16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sean-m-sullivan can we please add some integration and unit tests to validate this change?

@Ruchip16 Ruchip16 removed the request for review from KB-perByte April 2, 2025 06:52
@Ruchip16
Copy link
Member

Ruchip16 commented Apr 4, 2025

@sean-m-sullivan can you attach a playbook particularly route_policies_parsed.yml so that we can have a reproducer on our local setup

@sean-m-sullivan
Copy link
Contributor Author

Playbook

---
- name: Collect Facts
 hosts: all
 gather_facts: false
 
 tasks:
   - name: Get the current CISCO facts  ## IOSXR
     when: ansible_network_os == "cisco.iosxr.iosxr"
     cisco.iosxr.iosxr_facts:
       gather_subset: min 
       gather_network_resources: 
         - route_maps 
 
   - name: debug
     debug:
       var: ansible_fact

Also from a parsed config

- name: Collect Facts
 hosts: all
 gather_facts: false

 tasks:
   - name: Get the current CISCO facts  ## IOSXR
     when: ansible_network_os == "cisco.iosxr.iosxr"
     cisco.iosxr.iosxr_facts:
       gather_subset: min 
       gather_network_resources: 
         - route_maps 

   - name: debug
     debug:
       var: ansible_facts

linking case with more detail
https://access.redhat.com/support/cases/#/case/04095628

@Ruchip16
Copy link
Member

thanks @sean-m-sullivan i will get to this by this week!

@sean-m-sullivan
Copy link
Contributor Author

@Ruchip16 Update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants