diff --git a/napalm_panos/panos.py b/napalm_panos/panos.py index f3d7ecf..d62d264 100644 --- a/napalm_panos/panos.py +++ b/napalm_panos/panos.py @@ -472,6 +472,8 @@ def get_route_to(self, destination='', protocol=''): d['protocol'] = "ospf" if 'B' in flags: d['protocol'] = "bgp" + if 'H' in flags: + d['protocol'] = "host" if route['age'] is not None: d['age'] = int(route['age']) if route['nexthop'] is not None: diff --git a/test/unit/mocked_data/test_get_route_to/one_route/expected_result.json b/test/unit/mocked_data/test_get_route_to/one_route/expected_result.json index a98c183..3fa4ee0 100644 --- a/test/unit/mocked_data/test_get_route_to/one_route/expected_result.json +++ b/test/unit/mocked_data/test_get_route_to/one_route/expected_result.json @@ -1 +1 @@ -{"10.22.0.0/16": [{"protocol": "bgp", "last_active": false, "next_hop": "10.0.0.1", "outgoing_interface": "", "preference": -1, "inactive_reason": "", "current_active": true, "age": 2878517, "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {}}]} +{"10.22.0.0/16": [{"protocol": "bgp", "last_active": false, "next_hop": "10.0.0.1", "outgoing_interface": "", "preference": -1, "inactive_reason": "", "current_active": true, "age": 2832970, "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {}}]} diff --git a/test/unit/mocked_data/test_get_route_to/several_routes/expected_result.json b/test/unit/mocked_data/test_get_route_to/several_routes/expected_result.json index c9537c7..406b800 100644 --- a/test/unit/mocked_data/test_get_route_to/several_routes/expected_result.json +++ b/test/unit/mocked_data/test_get_route_to/several_routes/expected_result.json @@ -1 +1 @@ -{"10.0.0.128/30": [{"protocol": "connect","current_active": true,"age": -1,"routing_table": "default","next_hop": "10.0.0.1","outgoing_interface": "tunnel.34","preference": 0, "protocol_attributes": {}, "inactive_reason": "", "last_active": false, "selected_next_hop": false }], "192.168.1.1/32": [{"current_active": true,"age": -1,"routing_table": "default","next_hop": "0.0.0.0","outgoing_interface": "","preference": 0, "protocol_attributes": {}, "inactive_reason": "", "last_active": false, "selected_next_hop": false }], "10.0.0.132/30": [{"protocol": "connect","current_active": true,"age": -1,"routing_table": "default","next_hop": "10.0.0.2","outgoing_interface": "tunnel.35","preference": 0, "protocol_attributes": {}, "inactive_reason": "", "last_active": false, "selected_next_hop": false }]} +{"10.0.0.128/30": [{"protocol": "connect","current_active": true,"age": -1,"routing_table": "default","next_hop": "10.0.0.1","outgoing_interface": "tunnel.34","preference": 0, "protocol_attributes": {}, "inactive_reason": "", "last_active": false, "selected_next_hop": false }], "192.168.1.1/32": [{"protocol": "host", "current_active": true,"age": -1,"routing_table": "default","next_hop": "0.0.0.0","outgoing_interface": "","preference": 0, "protocol_attributes": {}, "inactive_reason": "", "last_active": false, "selected_next_hop": false }], "10.0.0.132/30": [{"protocol": "connect","current_active": true,"age": -1,"routing_table": "default","next_hop": "10.0.0.2","outgoing_interface": "tunnel.35","preference": 0, "protocol_attributes": {}, "inactive_reason": "", "last_active": false, "selected_next_hop": false }]}