#NEWLINE# def _cmp_by_local_origin( path1 , path2 ) : #NEWLINE# #INDENT# 'Select locally originating path as best path.\n\n    Locally originating routes are network routes, redistributed routes,\n    or aggregated routes. For now we are going to prefer routes received\n    through a Flexinet-Peer as locally originating route compared to routes\n    received from a BGP peer.\n    Returns None if given paths have same source.\n    ' #NEWLINE# if ( path1 . source == path2 . source ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( path1 . source is None ) : #NEWLINE# #INDENT# return path1 #NEWLINE# #UNINDENT# if ( path1 . source is None ) : #NEWLINE# #INDENT# return path2 #NEWLINE# #UNINDENT# return None