Only IPv4 supported, vrf aware, longer_prefixes parameter ready

def get_route_to(self, destination="", protocol=""):
        """
        Only IPv4 supported, vrf aware, longer_prefixes parameter ready
        """
        longer_pref = ""  # longer_prefixes support, for future use
        vrf = ""

        ip_version = None
        try:
            ip_version = IPNetwork(destination).version
        except AddrFormatError:
            return "Please specify a valid destination!"
        if ip_version == 4:  # process IPv4 routing table
            routes = {}
            if vrf:
                send_cmd = "show ip route vrf {vrf} {destination} {longer}".format(
                    vrf=vrf, destination=destination, longer=longer_pref
                ).rstrip()
            else:
                send_cmd = "show ip route vrf all {destination} {longer}".format(
                    destination=destination, longer=longer_pref
                ).rstrip()
            out_sh_ip_rou = self._send_command(send_cmd)
            # IP Route Table for VRF "TEST"
            for vrfsec in out_sh_ip_rou.split("IP Route Table for ")[1:]:
                if "Route not found" in vrfsec:
                    continue
                vrffound = False
                preffound = False
                nh_list = []
                cur_prefix = ""
                for line in vrfsec.split("\n"):
                    if not vrffound:
                        vrfstr = RE_RT_VRF_NAME.match(line)
                        if vrfstr:
                            curvrf = vrfstr.group(1)
                            vrffound = True
                    else:
                        # 10.10.56.0/24, ubest/mbest: 2/0
                        prefstr = RE_RT_IPV4_ROUTE_PREF.match(line)
                        if prefstr:
                            if preffound:  # precess previous prefix
                                if cur_prefix not in routes:
                                    routes[cur_prefix] = []
                                for nh in nh_list:
                                    routes[cur_prefix].append(nh)
                                nh_list = []
                            else:
                                preffound = True
                            cur_prefix = prefstr.group(1)
                            continue
                        #     *via 10.2.49.60, Vlan3013, [0/0], 1y18w, direct
                        #      via 10.17.205.132, Po77.3602, [110/20], 1y18w, ospf-1000,
                        #            type-2, tag 2112
                        #     *via 10.17.207.42, Eth3/7.212, [110/20], 02:19:36, ospf-1000, type-2,
                        #            tag 2121
                        #     *via 10.17.207.73, [1/0], 1y18w, static
                        #     *via 10.17.209.132%vrf2, Po87.3606, [20/20], 1y25w, bgp-65000,
                        #            external, tag 65000
                        #     *via Vlan596, [1/0], 1y18w, static
                        viastr = RE_IP_ROUTE_VIA_REGEX.match(line)
                        if viastr:
                            nh_used = viastr.group("used") == "*"
                            nh_ip = viastr.group("ip") or ""
                            # when next hop is leaked from other vrf, for future use
                            # nh_vrf = viastr.group('vrf')
                            nh_int = viastr.group("int")
                            nh_metric = viastr.group("metric")
                            nh_age = bgp_time_conversion(viastr.group("age"))
                            nh_source = viastr.group("source")
                            # for future use
                            # rest_of_line = viastr.group('rest')
                            # use only routes from specified protocol
                            if protocol and protocol != nh_source:
                                continue
                            # routing protocol process number, for future use
                            # nh_source_proc_nr = viastr.group('procnr)
                            if nh_int:
                                nh_int_canon = helpers.canonical_interface_name(nh_int)
                            else:
                                nh_int_canon = ""
                            route_entry = {
                                "protocol": nh_source,
                                "outgoing_interface": nh_int_canon,
                                "age": nh_age,
                                "current_active": nh_used,
                                "routing_table": curvrf,
                                "last_active": nh_used,
                                "next_hop": nh_ip,
                                "selected_next_hop": nh_used,
                                "inactive_reason": "",
                                "preference": int(nh_metric),
                            }
                            if nh_source == "bgp":
                                route_entry[
                                    "protocol_attributes"
                                ] = self._get_bgp_route_attr(cur_prefix, curvrf, nh_ip)
                            else:
                                route_entry["protocol_attributes"] = {}
                            nh_list.append(route_entry)
                # process last next hop entries
                if preffound:
                    if cur_prefix not in routes:
                        routes[cur_prefix] = []
                    for nh in nh_list:
                        routes[cur_prefix].append(nh)
        return routes