Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ansible/library/bgp_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ def run(self):
"""
Main method of the class
"""

# Check if bgp is enabled as a feature, and if not return facts with empty bgp_neighbors.
rc, self.out, err = self.module.run_command("show feature status bgp", executable='/bin/bash', use_unsafe_shell=True)
regex_bgp = re.compile(r'bgp\s+disabled')
if regex_bgp.search(self.out):
self.module.exit_json(ansible_facts=self.facts)

for instance in self.instances:
self.collect_data('summary', instance)
self.parse_summary()
Expand Down