def program_rtr_all_nwk_next_hop(self, tenant_id, rout_id, next_hop,<EOL>excl_list):
namespace = self.find_rtr_namespace(rout_id)<EOL>if namespace is None:<EOL><INDENT>LOG.error("<STR_LIT>", rout_id)<EOL>return False<EOL><DEDENT>net_list = self.get_network_by_tenant(tenant_id)<EOL>for net in net_list:<EOL><INDENT>subnet_lst = self.get_subnets_for_net(net.get('<STR_LIT:id>'))<EOL>for subnet_elem in subnet_lst:<EOL><INDENT>subnet = subnet_elem.get('<STR_LIT>').split('<STR_LIT:/>')[<NUM_LIT:0>]<EOL>subnet_and_mask = subnet_elem.get('<STR_LIT>')<EOL>if subnet not in excl_list:<EOL><INDENT>args = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', subnet_and_mask, '<STR_LIT>',<EOL>next_hop]<EOL>ret = self.program_rtr(args, rout_id, namespace=namespace)<EOL>if not ret:<EOL><INDENT>LOG.error("<STR_LIT>",<EOL>rout_id)<EOL>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return True<EOL>
Program the next hop for all networks of a tenant.