code: def program_rtr_all_nwk_next_hop(self, tenant_id, rout_id, next_hop,
                                       excl_list):
          
          namespace = self.find_rtr_namespace(rout_id)
          if namespace is None:
              LOG.error("Unable to find namespace for router %s", rout_id)
              return False
  
          net_list = self.get_network_by_tenant(tenant_id)
          for net in net_list:
              subnet_lst = self.get_subnets_for_net(net.get('id'))
              for subnet_elem in subnet_lst:
                  subnet = subnet_elem.get('cidr').split('/')[0]
                  subnet_and_mask = subnet_elem.get('cidr')
                  if subnet not in excl_list:
                      args = ['route', 'add', '-net', subnet_and_mask, 'gw',
                              next_hop]
                      ret = self.program_rtr(args, rout_id, namespace=namespace)
                      if not ret:
                          LOG.error("Program router returned error for %s",
                                    rout_id)
                          return False
          return True
docs: Program the next hop for all networks of a tenant.