def rtb_changed(route_tables=None, vpc_conn=None, module=None, vpc=None, igw=None):
 rtb_len = (len(route_tables) + 1)
 remote_rtb_len = len(vpc_conn.get_all_route_tables(filters={'vpc_id': vpc.id}))
 if (remote_rtb_len != rtb_len):
  return True
 for rt in route_tables:
  rt_id = None
  for sn in rt['subnets']:
   rsn = vpc_conn.get_all_subnets(filters={'cidr': sn, 'vpc_id': vpc.id})
   if (len(rsn) != 1):
    module.fail_json(msg='The subnet {0} to associate with route_table {1} does not exist, aborting'.format(sn, rt))
   nrt = vpc_conn.get_all_route_tables(filters={'vpc_id': vpc.id, 'association.subnet-id': rsn[0].id})
   if (not nrt):
    return True
   else:
    nrt = nrt[0]
    if (not rt_id):
     rt_id = nrt.id
     if (not routes_match(rt['routes'], nrt, igw)):
      return True
     continue
    elif (rt_id == nrt.id):
     continue
    else:
     return True
   return True
 return False

def rtb_changed ( route_tables = None , vpc_conn = None , module = None , vpc = None , igw = None ) : rtb_len = ( len ( route_tables ) + 1 ) remote_rtb_len = len ( vpc_conn . get_all_route_tables ( filters = { 'vpc_id' : vpc . id } ) ) if ( remote_rtb_len != rtb_len ) : return True for rt in route_tables : rt_id = None for sn in rt [ 'subnets' ] : rsn = vpc_conn . get_all_subnets ( filters = { 'cidr' : sn , 'vpc_id' : vpc . id } ) if ( len ( rsn ) != 1 ) : module . fail_json ( msg = 'The subnet {0} to associate with route_table {1} does not exist, aborting' . format ( sn , rt ) ) nrt = vpc_conn . get_all_route_tables ( filters = { 'vpc_id' : vpc . id , 'association.subnet-id' : rsn [ 0 ] . id } ) if ( not nrt ) : return True else : nrt = nrt [ 0 ] if ( not rt_id ) : rt_id = nrt . id if ( not routes_match ( rt [ 'routes' ] , nrt , igw ) ) : return True continue elif ( rt_id == nrt . id ) : continue else : return True return True return False
checks if the remote routes match the local routes .