def _handle_sync_devices(self, routers):
sync_devices_list = list(self.sync_devices)<EOL>LOG.debug("<STR_LIT>", sync_devices_list)<EOL>fetched_routers = self._fetch_router_info(device_ids=sync_devices_list)<EOL>if fetched_routers:<EOL><INDENT>LOG.debug("<STR_LIT>",<EOL>pp.pformat(fetched_routers))<EOL>for router_dict in fetched_routers:<EOL><INDENT>self._del_from_updated_routers_cache(router_dict['<STR_LIT:id>'])<EOL>self._del_from_removed_routers_cache(router_dict['<STR_LIT:id>'])<EOL>LOG.debug("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>router_dict['<STR_LIT:id>'])<EOL>self._router_removed(router_dict['<STR_LIT:id>'],<EOL>deconfigure=False)<EOL><DEDENT>self._cleanup_invalid_cfg(fetched_routers)<EOL>routers.extend(fetched_routers)<EOL>self.sync_devices.clear()<EOL>LOG.debug("<STR_LIT>",<EOL>sync_devices_list)<EOL><DEDENT>else:<EOL><INDENT>self.sync_devices_attempts += <NUM_LIT:1><EOL>if (self.sync_devices_attempts >=<EOL>cfg.CONF.cfg_agent.max_device_sync_attempts):<EOL><INDENT>LOG.debug("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(self.sync_devices_attempts,<EOL>cfg.CONF.cfg_agent.max_device_sync_attempts))<EOL>self.sync_devices.clear()<EOL>self.sync_devices_attempts = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>LOG.debug("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(self.sync_devices_attempts,<EOL>cfg.CONF.cfg_agent.max_device_sync_attempts,<EOL>pp.pformat(self.sync_devices)))<EOL><DEDENT><DEDENT>
Handles routers during a device_sync.

This method performs post-processing on routers fetched from the
routing plugin during a device sync.  Routers are first fetched
from the plugin based on the list of device_ids.  Since fetched
routers take precedence over pending work, matching router-ids
buffered in update_routers and removed_routers are discarded.
The existing router cache is also cleared in order to properly
trigger updates and deletes.  Lastly, invalid configuration in
the underlying hosting-device is deleted via _cleanup_invalid_cfg.

Modifies updated_routers, removed_routers, and sync_devices
attributes

:param routers: working list of routers as populated in
                process_services