@@ -328,16 +328,6 @@ def get_asicdb_routes(namespace):
328328 return (selector , subs , sorted (rt ))
329329
330330
331- def is_bgp_suppress_fib_pending_enabled (namespace ):
332- """
333- Retruns True if FIB suppression is enabled in BGP config, False otherwise
334- """
335- show_run_cmd = ['show' , 'runningconfiguration' , 'bgp' , '-n' , namespace ]
336-
337- output = subprocess .check_output (show_run_cmd , text = True )
338- return 'bgp suppress-fib-pending' in output
339-
340-
341331def is_suppress_fib_pending_enabled (namespace ):
342332 """
343333 Returns True if FIB suppression is enabled, False otherwise
@@ -791,20 +781,19 @@ def check_routes(namespace):
791781 results [namespace ] = {}
792782 results [namespace ]["Unaccounted_ROUTE_ENTRY_TABLE_entries" ] = rt_asic_miss
793783
794- if is_bgp_suppress_fib_pending_enabled (namespace ):
795- rt_frr_miss = check_frr_pending_routes (namespace )
796-
797- if rt_frr_miss :
798- if namespace not in results :
799- results [namespace ] = {}
800- results [namespace ]["missed_FRR_routes" ] = rt_frr_miss
784+ rt_frr_miss = check_frr_pending_routes (namespace )
801785
802- if results :
803- if rt_frr_miss and not rt_appl_miss and not rt_asic_miss :
804- print_message (syslog .LOG_ERR , "Some routes are not set offloaded in FRR{} but all "
805- "routes in APPL_DB and ASIC_DB are in sync" .format (namespace ))
806- if is_suppress_fib_pending_enabled (namespace ):
807- mitigate_installed_not_offloaded_frr_routes (namespace , rt_frr_miss , rt_appl )
786+ if rt_frr_miss :
787+ if namespace not in results :
788+ results [namespace ] = {}
789+ results [namespace ]["missed_FRR_routes" ] = rt_frr_miss
790+
791+ if results :
792+ if rt_frr_miss and not rt_appl_miss and not rt_asic_miss :
793+ print_message (syslog .LOG_ERR , "Some routes are not set offloaded in FRR{} \
794+ but all routes in APPL_DB and ASIC_DB are in sync" .format (namespace ))
795+ if is_suppress_fib_pending_enabled (namespace ):
796+ mitigate_installed_not_offloaded_frr_routes (namespace , rt_frr_miss , rt_appl )
808797
809798 if results :
810799 print_message (syslog .LOG_WARNING , "Failure results: {" , json .dumps (results , indent = 4 ), "}" )
0 commit comments